[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hash Table Collisions (n.runs-SA-2011.004)
- From: Miles Bader <miles@...>
- Date: Wed, 04 Jan 2012 17:03:32 +0900
David Kolf <kolf@gmx.de> 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.
-miles
--
Joy, n. An emotion variously excited, but in its highest degree arising from
the contemplation of grief in another.
- References:
- Re: Hash Table Collisions (n.runs-SA-2011.004), TNHarris
- Re: Hash Table Collisions (n.runs-SA-2011.004), Mark Hamburg
- Re: Hash Table Collisions (n.runs-SA-2011.004), Tom N Harris
- Re: Hash Table Collisions (n.runs-SA-2011.004), Mark Hamburg
- Re: Hash Table Collisions (n.runs-SA-2011.004), Vladimir Protasov
- Re: Hash Table Collisions (n.runs-SA-2011.004), Leo Razoumov
- Re: Hash Table Collisions (n.runs-SA-2011.004), Vladimir Protasov
- Re: Hash Table Collisions (n.runs-SA-2011.004), Miles Bader
- Re: Hash Table Collisions (n.runs-SA-2011.004), Ashwin Hirschi
- Re: Hash Table Collisions (n.runs-SA-2011.004), Miles Bader
- Re: Hash Table Collisions (n.runs-SA-2011.004), David Kolf