[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua5 / poor performance
- From: "Russell Y. Webb" <rw20@...>
- Date: Thu, 20 Mar 2003 08:25:31 -0800
Any solution to this problem must change the way Lua hashes non-integer
numbers. One particular solution is this:
I seem to recall that the string hashing function takes the length of
string to hash so how about just hashing non-integer numbers like this
(sorry for not looking up the actual routines, but you get the idea):
hash_of_nonint = string_hash((char *)&number, sizeof(number));
Not even all that ugly if you think of string_hash as more of a
memory_block_hash function.
Hashing to the integer parts does seem amazingly poor in corner cases.
Russ