lua-users home
lua-l archive

Re: Using Lua's string interning for faster compares?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Try Ragel[1].
>
> [1]: http://www.complang.org/ragel/
> Alternatively, re2c does the same thing: http://re2c.org/ (for simple
Wow, the generated code is so branch-y!
What I do is compute the hash of the key (I usually use djb2) and use that in the comparisons. You can use Lua's internal hash if you don't mind changing Lua's source code and recompiling. Both techniques are discussed here:
http://altdevblogaday.com/2011/08/06/a-little-trick-to-make-faster-lua-bindings/
Cheers,
Andre

AltStyle によって変換されたページ (->オリジナル) /