Skip to content
Snippets Groups Projects
Unverified Commit 4b39ff00 authored by Alexander Theißen's avatar Alexander Theißen Committed by GitHub
Browse files

revive: Rework the instruction benchmark (#7721)


Fixes https://github.com/paritytech/polkadot-sdk/issues/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 PolkaVM `Gas` 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.

---------

Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: default avatarxermicus <cyrill@parity.io>
Co-authored-by: default avatarPG Herveou <pgherveou@gmail.com>
parent 3798ff7f
Branches
No related merge requests found
Pipeline #517573 waiting for manual action with stages
in 45 minutes and 55 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment