3 ms·
Couldn't HyperLogLog be implemented efficiently using Lua scripting?
by eurleif 13y ago
Couldn't HyperLogLog be implemented efficiently using Lua scripting?
- lifthrasiir 13y agoI haven't tried (so have a grain of salt), but I guess it would be certainly slower than the native implementation for various reasons. One reason that Lua does not support an efficient integer type yet (AFAIK 5.3 will support it though) comes to mind.
- dbro 13y agoYes it's possible. I did this a few years ago as a learning project, and the relevant lua scripts can be seen here: https://gist.github.com/dbro/9920666 https://gist.github.com/dbro/9920666. ... but I wouldn't claim that it's done efficiently. From the comments in the code's tests: # some results based on running speed tests on a lightweight netbook: # standard error = 0.01, 10kb of registers # < 1 ms per init() # < 1 ms per update() # < 1 ms per count() for single set # ~30 ms per set for count() of union of sets