delta_for: Hoist end() out of the loop check#30864
Merged
Merged
Conversation
Avoid rebuilding the default end iterator on every scanned element. end() didn't get optimized out and it's not entirely free in this iterator's case. Hoise it out manually. Possibly this addresses some noise we are seeing.
Amortize start/stop timer overhead for fast find benchmarks.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces iterator-related overhead in delta_for searches by caching end() iterators outside tight loops, and updates the associated micro-benchmark to batch find() calls and report operation counts to the perf harness.
Changes:
- Hoist
end()/this->end()out of loop conditions indeltafor_frame::pred_searchand bothdeltafor_column::pred_searchimplementations. - Update
delta_for_bench.ccfind_testto perform batchedfind()calls and return the batch size so perf results are normalized per operation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/v/utils/tests/delta_for_bench.cc |
Batch find() benchmark iterations and return operation count for perf normalization. |
src/v/utils/delta_for.h |
Cache end() iterators to avoid reconstructing them on every loop condition check during scans. |
Collaborator
CI test resultstest results on build#86095 |
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.
Avoid rebuilding the default end iterator on every scanned element.
end() didn't get optimized out and it's not entirely free in this
iterator's case. Hoise it out manually.
Possibly this addresses some noise we are seeing.
Backports Required
Release Notes