Skip to content

Avoid per-register exponentiation in dense estimates - #75

Merged
Seif Lotfy (seiflotfy) merged 2 commits into
axiomhq:mainfrom
perfloop-oss:perfloop-pr-open-8tw28s9h12
Oct 24, 2026
Merged

Seif Lotfy (seiflotfy) merged 2 commits into
axiomhq:mainfrom
perfloop-oss:perfloop-pr-open-8tw28s9h12

Conversation

@perfloop-agent

Copy link
Copy Markdown
Contributor

Dense estimates apply a general math.Pow call to every register while calculating a count. This replaces it with exact reciprocal powers for valid ranks 0–61, preserving zero counting, accumulation order, and the final estimate correction.

The regression tests compare the old calculation bit-for-bit and check estimates after distinct and duplicate inserts, merge, reset/reuse, and binary round trips at precisions 4–18. A native Go benchmark measures complete p14 Sketch.Estimate() calls on a retained NewNoSparse() sketch populated with distinct and duplicate inserts before timing.

On workload populated NewNoSparse p14 Estimate, median metric ns/op changed from 300531 to 52747; paired median delta -248192 (-82.6% of baseline; at least 19/20 confidence interval -259959 to -241076 from 10 pairs).

Checks: 1 passed.

The benchmark uses one constructed register state. Production use of dense mode, rank distributions, and query frequency remain unmeasured; production telemetry after deployment is needed to establish those. CI / Test and build and CircleCI / build remain target-CI checks.


Generated by Perfloop. Human sponsor: Tomás Senart. Measurements and checks.

@seiflotfy
Seif Lotfy (seiflotfy) merged commit 2543215 into axiomhq:main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants