-
Notifications
You must be signed in to change notification settings - Fork 835
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
revive: Rework the instruction benchmark #7721
base: master
Are you sure you want to change the base?
Conversation
/cmd bench --runtime dev --pallet pallet_revive --clean |
Command "bench --runtime dev --pallet pallet_revive --clean" has started 🚀 See logs here |
…t_revive --clean'
Command "bench --runtime dev --pallet pallet_revive --clean" has finished ✅ See logs here Subweight results:
Command output:✅ Successful benchmarks of runtimes/pallets: |
|
||
// Create all possible addresses and shuffle them. This makes sure | ||
// the accesses are random but no address is accessed more than once. | ||
// we skip the first address since it is out entry point |
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.
// we skip the first address since it is out entry point | |
// we skip the first address since it is our entry point |
Fixes #6157
This fixes the last remaining benchmark that was not correct since it was too low level to be written in Rust. Instead, we opted.
This PR changes the benchmark that determines the scaling from
ref_time
to PolkaVMGas
by benchmarking the absolute worst case of an instruction: One that causes two cache misses by touching two cache lines.The Contract itself is designed to be as simple as possible. It does random unaligned reads in a loop until the
r
(repetition) number is reached. The randomness is fully generated by the host and written to the guests memory before the benchmark is run. This allows the benchmark to determine the influence of one loop iteration via linear regression.