Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance: simplify and optimize kth-greatest computation (96% recall at 195 qps) #616

Merged
merged 7 commits into from
Dec 1, 2023

Conversation

alexklibisz
Copy link
Owner

@alexklibisz alexklibisz commented Dec 1, 2023

Related Issue

#611

Changes

This integrates the kth-greatest computation into the ArrayHitCounter, which gets rid of a loop for finding the min and max counts. While we're there, also removing the min count, since that is almost always zero and using an array of shorts for the histograms.

In aggregate, this gets the benchmarks up to 0.96 at 195 qps:

image

Though they did float around a bit (see the Benchmark commits).

Testing and Validation

Added more unit tests for the ArrayHitCounter.

@alexklibisz alexklibisz marked this pull request as ready for review December 1, 2023 16:01
@alexklibisz alexklibisz changed the title Performance: simplify and optimize kth-greatest computation Performance: simplify and optimize kth-greatest computation (96% recall at 195 qps) Dec 1, 2023
@alexklibisz alexklibisz merged commit ea383d8 into main Dec 1, 2023
5 checks passed
@alexklibisz alexklibisz deleted the 611-optimize-kth-greatest branch December 1, 2023 16:02
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.

1 participant