Use binary search in ArrayRangeSet#2614
Open
fabalchemy wants to merge 1 commit into
Open
Conversation
bdaedf6 to
51517f2
Compare
Collaborator
|
Nice use of Does this have a statistically significant impact on e2e benchmarks? The microbenchmark results look great, but I want to be sure we're not pessimizing real-world workloads, which may not be fairly represented by bulk inserts. |
Author
|
I ran the I'm a bit surprised by the noise, but this is expected judging by other PRs. Linear scan: Binary search: |
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.
This PR modifies the
ArrayRangeSetimplementation to use binary search instead of linear scan for insertions and removals, as suggested on Discord.I also wrote two basic
criterionbenchmarks:sizesizewith occasional holesBut did not include them in this PR since I'm not sure they're super meaningful and require a bunch of noisy diffs in
quinn-prototo expose the types for the benchmarks.They show limited gains (but no regression) for smaller sets, but significant improvements for larger sets, especially for the linear scenario which I believe is closer to the expected usage in
quinn.