-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add feature to profile just the block validation #17168
Merged
Merged
Conversation
This file contains 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
arvidn
added
the
Added
Required label for PR that categorizes merge commit message as "Added" for changelog
label
Dec 26, 2023
Pull Request Test Coverage Report for Build 7376667166
💛 - Coveralls |
arvidn
force-pushed
the
block-validation-profile
branch
from
January 1, 2024 10:24
f22811e
to
68bdbed
Compare
This comment was marked as resolved.
This comment was marked as resolved.
arvidn
force-pushed
the
block-validation-profile
branch
from
January 3, 2024 10:44
68bdbed
to
8fd0fa4
Compare
…s actually going on while we validate blocks. Sometimes the block validation times are affected by other tasks that hog the CPU, blocking the main co-routine from being scheduled
arvidn
force-pushed
the
block-validation-profile
branch
from
January 3, 2024 10:49
8fd0fa4
to
7659a29
Compare
AmineKhaldi
approved these changes
Jan 3, 2024
wjblanke
approved these changes
Jan 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aok
mikehw
pushed a commit
to mikehw/chia-blockchain
that referenced
this pull request
Jan 11, 2024
add feature to profile just the block validation. This exposes what is actually going on while we validate blocks. Sometimes the block validation times are affected by other tasks that hog the CPU, blocking the main co-routine from being scheduled
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 exposes what is actually going on while we validate blocks. Sometimes the block validation times are affected by other tasks that hog the CPU, blocking the main co-routine from being scheduled.
Purpose:
When understanding what's causing spikes in block validation times, having a profile focused only on the time of validating the block can be quite helpful, especially when pre_validation nor post_processing takes very long.
It can help identify co-routines that run for too long (i.e. perform expensive work in the main thread), hogging the scheduler and delaying other tasks.
Current Behavior:
The only available profiler is for the whole full node task.
New Behavior:
There's now also a profiler for just block validation. If the validation takes longer than 2 seconds, the profile is saved for later analysis.
Testing Notes:
Example profiles from
main
.(parsing the
SubEpochChallengeSegments
is slow)(serializing the weight proof is slow)
(parsing
BlockRecord
is slow)(
sleep(0.01)
in a loop is slow)(merkle root validation and BLS signatures can still be expensive)
(saving peers is slow. This caused an 11.9 seconds block validation)
(request_additions is slow)