-
Notifications
You must be signed in to change notification settings - Fork 15
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
chore: gradual benchmark pub rand #214
Conversation
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.
Nice work!
@@ -1016,3 +1016,83 @@ func (fp *FinalityProviderInstance) GetFinalityProviderSlashedOrJailedWithRetry( | |||
|
|||
return slashed, jailed, nil | |||
} | |||
|
|||
// CommitPubRandTiming - helper struct used to capture times for benchmark | |||
type CommitPubRandTiming struct { |
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.
can we move all the helper functionalities to a separate file, maybe benchmark_helper.go
?
b.ReportMetric(float64(totalTiming.GetPubRandListTime.Nanoseconds())/float64(b.N), "ns/GetPubRandList") | ||
b.ReportMetric(float64(totalTiming.AddPubRandProofListTime.Nanoseconds())/float64(b.N), "ns/AddPubRandProofList") | ||
b.ReportMetric(float64(totalTiming.CommitPubRandListTime.Nanoseconds())/float64(b.N), "ns/CommitPubRandList") |
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.
it would be more helpful if we can show the persontage of each part. Does go benchmark support it?
I had to introduce helper functions to get gradual timing of functions inside
commitPubRandPairs
.Findings
Seems that most of the time is spent at
GetPubRandList
followingAddPubRandProofList
. As input (NumPubRand) grows we see an increase in time.Results:
Closes