lua-users home
lua-l archive

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

On 12/18/07, Asko Kauppi <> wrote:
> You can push all the strings in startup on the registry, with light
> userdata pointers (of the C side string constant) serving as keys.
> This will turn string pushing into a table lookup instead; maybe no
> better at all?

yep, that's roughly what i do for functions that might be used in a
tight loop.  it means at least one extra table lookup (more if the
'constants' are in a hard-to-find table).  after so much stressing of
the high performance of strings management and clever hashing
algorithms, i'll try to benchmark one against the other (hash every
time, vs. table lookup to get the string).  who knows, we might be
surprised :)