4 ms·
That hilbert() function is nuts
by bytematic 8y ago
That hilbert() function is nuts
- pradn 8y agoLink: https://github.com/mourner/flatbush/blob/eb61250246df5ebb4c9671cb2a2c7b51d8f64f86/index.js#L325 https://github.com/mourner/flatbush/blob/eb61250246df5ebb4c9...
- vanderZwan 8y agoHmmm... delicious bitmasking. That's when you know the author is serious about squeezing performance out of a JS VM: forcing 32 bit integer optimizations.
- mourner 8y agoNote that the hilbert function wasn't written by me, just merely ported from C++ — here's a post about it by the original author: http://threadlocalmutex.com/?p=126 http://threadlocalmutex.com/?p=126
- vanderZwan 8y ago> here's a post about it by the original author: http://threadlocalmutex.com/?p=126 http://threadlocalmutex.com/?p=126 Nice! But still: you did port it from C++, and consciously or not, that optimization still applies.