perf(stages): avoid v2 history count pre-pass#23295
Closed
yongkangc wants to merge 4 commits into
Closed
Conversation
Co-authored-by: YK <46377366+yongkangc@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d420d-4530-756b-856b-e3c3b0d8522b
Contributor
|
Co-authored-by: YK <46377366+yongkangc@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d420d-4530-756b-856b-e3c3b0d8522b
Co-authored-by: YK <46377366+yongkangc@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d420d-4530-756b-856b-e3c3b0d8522b
Co-authored-by: YK <46377366+yongkangc@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d420d-4530-756b-856b-e3c3b0d8522b
Contributor
Author
|
Closing this in favor of #23296, which addresses the same bottleneck with a smaller change. It makes O(files) instead of O(blocks), preserves the existing progress accounting, and fixes the hot path without changing the stage collection logic. |
Contributor
Author
|
Closing this in favor of #23296, which addresses the same bottleneck with a smaller change. It makes |
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.
storage_v2 history indexing was paying a near-fixed per-cycle cost even when only a small live tail needed processing. Both history stages called
account_changeset_count()/storage_changeset_count()only to format progress logs, and those helpers scanned.csoffmetadata across finalized static files.This removes that pre-pass from the live-sync path by logging progress against the requested block range instead. It also makes the count helpers themselves cheaper by reading only the last committed
.csoffrecord per static file, so remaining callers no longer materialize every offset record.Repro gist: https://gist.github.com/yongkangc/06d1da54a32b4a1818c9432483fef7a6
Repro setup:
cargo test -p reth-stages repro_collect_bottleneck_breakdown -- --ignored --nocaptureCo-Authored-By: YK 46377366+yongkangc@users.noreply.github.com
Prompted by: yongkangc