zig-hyperloglog
Languages and libraries
algorithm library
SHOW HN2023
How HN took it
2 positive, 13 neutral or asking, 0 mixed, 0 critical, out of 15 comments about the project. Thread score +0.14.
The thread, comment by comment
Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.
positive neutral or mixed critical about another commenter or something else the maker
What HN said
What people liked
Commenters find the project awesome and cool
From 2 comments
This is awesome... question though: ```pub fn HyperLogLog(comptime p: u8) type { return struct { dense: [1<<p]u6; ``` const Self = @This(); pub fn init() Self { var s = Self {};…
seiflotfy on HNLooks cool. What are some applications of a cardinality estimator?
extasia on HN
Objections
Dense representation allocates 1<<p bytes upfront, undermining the sparse representation
From 2 comments
This is awesome... question though: ```pub fn HyperLogLog(comptime p: u8) type { return struct { dense: [1<<p]u6; ``` const Self = @This(); pub fn init() Self { var s = Self {};…
seiflotfy on HN> doesn't this allocate 1<<p upfront though Yes, it does. The idea (see the last code snipped in that post), is that the user delays the creation of the HLL until they are ready…
kristoff_it on HN
Heap allocation forced on the user is not idiomatic
From 1 comment
One change to make this library more idiomatic would be to make HyperLogLog avoid forcing heap allocation on the user. So from this (simplified code): ``` pub fn…
kristoff_it on HN
Requests
Allow user to choose memory placement without forced heap allocation
From 1 comment
One change to make this library more idiomatic would be to make HyperLogLog avoid forcing heap allocation on the user. So from this (simplified code): ``` pub fn…
kristoff_it on HN
Questions
What are the applications of a cardinality estimator?
From 3 comments
Looks cool. What are some applications of a cardinality estimator?
extasia on HNMemory bound alternative for the COUNT(DISTINCT ...) aggregate function in SQL. ClickHouse[1] has a few functions for that, with different tradeoffs in memory usage, precision,…
zX41ZdbW on HNVarious aspects of query optimization like join planning and predicate selectivity estimation, e.g. as discussed in https://arxiv.org/abs/2010.00728
refset on HN
Why Zig rather than Go or V?
From 2 comments
Awesome! Does Axiom use Zig? Most of your projects seem to be in Go. Why did you choose to do this in Zig?
eatonphil on HNI'm also very curious to know this. HyperLogLog is written in Go: https://github.com/axiomhq/hyperloglog I would expect V to be a more natural choice for a port than Zig.
henry_viii on HN
Alternatives named
Go HyperLogLog implementation by Axiom
From 1 comment
I'm also very curious to know this. HyperLogLog is written in Go: https://github.com/axiomhq/hyperloglog I would expect V to be a more natural choice for a port than Zig.
henry_viii on HN
Redis HyperLogLog
From 1 comment
Or alternatively one could make good use of the existing buffer and use that to encode the sparse representation, like Antirez did in Redis:…
kristoff_it on HN
ClickHouse uniqCombined and uniq functions
From 1 comment
Memory bound alternative for the COUNT(DISTINCT ...) aggregate function in SQL. ClickHouse[1] has a few functions for that, with different tradeoffs in memory usage, precision,…
zX41ZdbW on HN