So I threw in some code: https://gist.github.com/2837822 That does something similiar to what you described (but not necessarily completely similiar): it just does some int32 bitwise operations.
On my machine x64.release build of V8 takes 8ms (0.00008 ms per key). If I start casting result to uint32 via >>> 0, I get to 36ms (0.00036ms per key). Limiting number of bits inside the table does not improve anything (which is quite expected with code shaped like that). -- Vyacheslav Egorov On Wed, May 30, 2012 at 7:10 PM, Joran Greef <[email protected]> wrote: > Keeping everything as Int32 but casting using "return hash >>> 0" > isĀ 0.00022ms per key. > > Keeping everything as Int32 but casting using "return hash < 0 ? 4294967296 > + hash : hash" is 0.000051ms per key, order of magnitude faster and still > 32-bit. > > > On Wednesday, May 30, 2012 6:25:39 PM UTC+2, Vyacheslav Egorov wrote: >> >> c) stop doing >>> 0 at the end; > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
