Re: Rewrite of string case statements in hash map jump table

2017-08-02 Thread Parashurama
I'm working on a similar problem. The performance for parsing/stringifying enums with holes is abysmal (in C anyway, JS is mostly fine). The problem is getting acceptable performance without importing the tables module which is kinda huge, needs modules math, hashes and others. I tried various

Re: Rewrite of string case statements in hash map jump table

2017-08-02 Thread Parashurama
you can find the code in $NIM_SRC_DIR/compiler/ccgexprs.nim inside proc `genStringCase` I'm working on a similar problem. The performance for parsing/stringying enums with holes is abysmal (in C anyway, JS is mostly fine). The problem is getting acceptable performance without imp

Re: Rewrite of string case statements in hash map jump table

2017-08-02 Thread cdome
Thanks Parashurama, Found genStringCase in ccgstmts.nim, but your hint was useful

Rewrite of string case statements in hash map jump table

2017-08-02 Thread cdome
Hi, I recall Araq mentioned Nim compiler rewrites string case statements into hash jump table for efficiency, Does anyone knows where is the code in compiler#s code base that does that. Thank you