rhll
A Rust-powered HyperLogLog cardinality estimator for Python, exposed via PyO3.
Benchmarks
Up to 10M inserts, single-threaded, release build, rhll vs. datasketch
vs. the HLL C extension. Full methodology, machine details, and
count-accuracy numbers: benchmarks/results.md.
| n | rhll | datasketch | HLL |
|---|---|---|---|
| 10,000 | 0.001s | 0.014s | 0.001s |
| 100,000 | 0.005s | 0.123s | 0.009s |
| 1,000,000 | 0.057s | 1.288s | 0.086s |
| 10,000,000 | 0.555s | 12.399s | 0.891s |
rhll is ~22x faster than datasketch at 10M inserts, and slightly faster
than the HLL C extension. count() accuracy is in the same ballpark as
both (0.64% error, vs. 0.77% for HLL and 0.57% for datasketch, on a
10M-item dataset at p=14).
Usage
from rhll import HyperLogLog
h = HyperLogLog(p=12) # default p=12 -> 4096 registers
h.update(b"some-value") # add a single item (bytes)
h.update_str("some-value") # convenience: str -> utf8 -> update
h.count() # -> float, estimated cardinality
h2 = HyperLogLog(p=12)
h2.update(b"other-value")
h.merge(h2) # in-place union, requires matching p
h3 = h.copy() # deep copy
len(h.registers()) # raw register bytes, for debugging/serialization
data = h.to_bytes()
restored = HyperLogLog.from_bytes(data)
Design notes
- Hashing:
xxh3_64(viaxxhash-rust) rather thandatasketch's SHA1, much faster and still well-distributed for this use case. - Precision
p: valid range 4–18,m = 2^pregisters, oneu8per register (no bit-packing in v1). - Merging: sketches must share the same
p; merging mismatched sketches raisesValueErrorrather than silently resizing. - Serialization:
to_bytes()/from_bytes()is[p][registers...], no compression, no versioning beyondp-derived length checks.
Out of scope for v1: HyperLogLog++ (sparse mode), arbitrary hashable objects, distributed merge/persistence beyond raw bytes.
Metadata
Release files for rhll 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rhll-0.1.0.tar.gz | 13.0 kB | With provenance | Details for rhll-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| rhll-0.1.0-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for rhll-0.1.0-cp311-abi3-win_amd64.whl |
| rhll-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for rhll-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| rhll-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details for rhll-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| rhll-0.1.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for rhll-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
| rhll-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details for rhll-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl |
Total release size: 1.1 MB
Release files / rhll-0.1.0.tar.gz
| Download URL | rhll-0.1.0.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e64ae96c909a32665e2dda9038b74e4440bba1a331b8ea3c446c764078f222ff
|
|
BLAKE2b-256 checksum How to use checksums |
62517fd65428fd3419f0ddb371bb628fb259591be77b45c2e8e41515fb295851
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logRelease files / rhll-0.1.0-cp311-abi3-win_amd64.whl
| Download URL | rhll-0.1.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 129.7 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1a4fc0e2e9cc2aeb5bdbaf8740f4b8fd700927368ec3baeb676c44b28a93f01a
|
|
BLAKE2b-256 checksum How to use checksums |
84953bd3c07850c14583709b908012323e4dd3405f0b2f7f0cc528875ce8578a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logRelease files / rhll-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rhll-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 269.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
85af97f750318c766e824e8edc1f9529155d6e3165ec410bdd281e20dbd16c95
|
|
BLAKE2b-256 checksum How to use checksums |
fd6d597d61bc802a65435503eec02d2e547c0d00f750f2000805eb9d2c1fdad8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logRelease files / rhll-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rhll-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 266.1 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e9b0c3910b9f43e56e2ee67bc243cb41bc257531cbc25d3c5e7946c1fbaad18e
|
|
BLAKE2b-256 checksum How to use checksums |
4d331d465ce5e2f11bda2cba518d87f89f691388cb4bfaebe1b4d349fd123d07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logRelease files / rhll-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | rhll-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 236.2 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
481c01ff7ceadbe71be61b312047a7f8895df14f0801ad1fcd32db77e6aaec2f
|
|
BLAKE2b-256 checksum How to use checksums |
de58e0e850767b2f55c7d62a4726af7c04bd175da90de0c00acca105d358df53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logRelease files / rhll-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | rhll-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 234.5 kB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
8141bfde7ad7b03a77995a1a47168c557664ef4876d4140bb6e7635ce4b3ed9d
|
|
BLAKE2b-256 checksum How to use checksums |
ce3516fb717c54c75e7fdfaacc4d4e0fc735cadd19b508e03fa9591eb86db051
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logSecurity for rhll 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for rhll-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.