Repository navigation
Avoid per-register exponentiation in dense estimates - #75
Merged
Seif Lotfy (seiflotfy) merged 2 commits intoOct 24, 2026
Merged
Seif Lotfy (seiflotfy) merged 2 commits into
Seif Lotfy (seiflotfy) merged 2 commits into
Conversation
Signed-off-by: Perfloop Agent <[email protected]>
Signed-off-by: Perfloop Agent <[email protected]>
Seif Lotfy (seiflotfy)
approved these changes
Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dense estimates apply a general
math.Powcall 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 retainedNewNoSparse()sketch populated with distinct and duplicate inserts before timing.On workload
populated NewNoSparse p14 Estimate, median metricns/opchanged 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 buildandCircleCI / buildremain target-CI checks.Generated by Perfloop. Human sponsor: Tomás Senart. Measurements and checks.