Skip to content
Unverified Commit e02c5204 authored by Robin Freyler's avatar Robin Freyler Committed by GitHub
Browse files

Update Wasm benchmarks (#2957)

In https://github.com/paritytech/polkadot-sdk/pull/2941 we found out
that the new Wasmi (register) is very effective at optimizing away
certain benchmark bytecode constructs in a way that created an unfair
advantage over Wasmi (stack) which yielded our former benchmarks to be
ineffective at properly measuring the performance impact.

This PR adjusts both affected benchmarks to fix the stated problems.
Affected are
- `instr_i64const` -> `instr_i64add`: Renamed since it now measures the
performance impact of the Wasm `i64.add` instruction with locals as
inputs and outputs. This makes it impossible for Wasmi (register) to
aggressively optimize away the entire function body (as it previously
did) but still provides a way for Wasmi (register) to shine with its
register based execution model.
- `call_with_code_per_byte`: Now uses `local.get` instead of `i32.const`
for the `if` condition which prevents Wasmi (register) to aggressively
optimizing away whole parts of the `if` creating an unfair advantage.

cc @athei



---------

Co-authored-by: command-bot <>
Co-authored-by: default avatarAlexander Theißen <[email protected]>
Co-authored-by: default avatarIgnacio Palacios <[email protected]>
parent 320b5289
Pipeline #436259 failed with stages
in 1 hour, 35 minutes, and 32 seconds