lua-users home
lua-l archive

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

David Kolf <> writes:
>> An "all characters" hash is not free, especially for _very_ long
>> strings (I regularly handle 500MB strings), and the benefit of such a
>> change needs to be weighed against the costs, weighted by the
>> likelihood of each case.
> Yes, Lua can't just copy the solution of other languages because the
> hash needs to skip characters. However, the solution for Lua was
> already proposed here. A self-balancing tree in the string table seems
> to solve the problem.

Sure, if there's a solution that gets the best of both worlds (hopefully
without excessive code bloat or complexity), then that would be great.

I guess all I'm trying to say is that the issue needs more consideration
than just "oh well, hash all chars, done!"  [of course, as has also been
noted in this thread, even hashing all characters isn't sufficient]

Hopefully the Lua devs can weigh in with their thoughts.


Joy, n. An emotion variously excited, but in its highest degree arising from
the contemplation of grief in another.