Optimistic state prefetch#4238
Open
bhartnett wants to merge 29 commits into
Open
Conversation
…and add concurrency utils test.
Contributor
Author
|
Imported 50000 blocks starting at block 24 million with stateroot checks disabled using 16 threads: That's a ~28% improvement. |
tersec
reviewed
May 21, 2026
tersec
reviewed
May 21, 2026
tersec
reviewed
May 21, 2026
Contributor
Author
|
Imported 500000 blocks starting at block 15 million with stateroot checks disabled using 16 threads: In a longer run there is not as much improvement. I guess this is expected because once the caches are warmed up the prefetching doesn't have as much impact. With that in mind, having better performance when the caches are empty will still be beneficial for various scenarios such as the benchmarking tests. |
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.
Changes in this PR:
The benchmarking results for this look good so far:
Imported 20000 blocks starting at block 15 million with stateroot checks disabled using 16 threads:
master - elapsed=19m46s83ms
concurrentlru (without prefetch) - elapsed=23m11s610ms
optimistic-state-prefetch (with prefetch enabled) - elapsed=11m878ms781us
The ConcurrentLruCache does cause a slow down for the single threaded block import but when the prefetch is enabled in background threads to fill the caches we get a large speedup.