lua-users home
lua-l archive

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


> Intern on first compare is not easy to implement, there are a lot of
> complications. A quick-and-dirty attempt at using long string hash
> values to avoid extra memcmp() work didn't really work (a few %
> slower than default lua-5.2.1wk1) because in the examples I am
> using, there are a lot of equal compares (76%) which means memcmp()
> is still mostly needed. Short string compares is still much faster.

A possible small optimization is to check whether "a == b" in
'luaS_eqlngstr', before doing the memcmp.

-- Roberto