I am facing performance issues when using switch statements with a large number of cases.
Defining a new command with an single argument (type int) and returning different content is working as expected BUT the compilation time is depending on the argument:
\tablexy{100} is fast but
\tablexy{6000} takes more than 30 seconds (i guess because it is at the very end of the switch statement)
Code: Select all
\newcommand{\tablexy}[1]{
\int_case:nnF{#1}{
{100}{some content}
{101}{some other content}
...
{6000}{again something different}
}
I was first thinking of having a single command for each number like \tablexy100 ... \tablexy6000 but that is not possible because of the numbers in the command name.
The latex code is generated with c# from am Dictionary<int,string> (where the string contains latex code for tables) and i am open to other approaches. Just need to pick content out of this list based on the key (int).