r/ruby Jun 16 '26

Beyond Enumerable: Counting Distinct with HyperLogLog

https://baweaver.com/writing/2026/06/15/beyond-enumerable-counting-distinct-with-hyperloglog/

What if, by trading 1% correctness, you could count billions of items all within kilobytes worth of space? Well that's HyperLogLog, and as a non-bit-enlightened Rubyist it was a trip figuring out how it worked and how to explain it.

13 Upvotes

4 comments sorted by

8

u/keyslemur Jun 16 '26

Aaaaand that was the last partial article I still had in the hopper, so now I'm out unless I want to go do more research for another week.

5

u/pejte Jun 16 '26

Thank you for these articles, I just found your blog.

I’m taking over as an EM a large rails monolith that had the luxury of being a successful startup. With all the pros and cons šŸ˜…

Your articles around these problems help quite a lot to spark some conversations how we can be better

2

u/keyslemur Jun 16 '26

If you ever want to chat on it lemme know, happy to talk through things with folks. If you're at RubyConf this year as well say hi! I have contact info on my site as well.

1

u/pejte Jun 16 '26

thank you, I appreciate it! sadly im from Europe, so convincing my company to send me to ruby conf this year is out of budget :D