wasmi-labs / wasmi

WebAssembly (Wasm) interpreter.
https://wasmi-labs.github.io/wasmi/
Apache License 2.0
1.52k stars 274 forks source link

Optimize memory access in the Wasmi executor #1062

Closed Robbepop closed 2 weeks ago

Robbepop commented 3 weeks ago

This has fewer indirections when using the default linear memory. Local perf measurements indicated up to 20% improvements for memory-intense workloads. Unfortunately it seems that call-intense workloads regress.

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 67.15686% with 67 lines in your changes missing coverage. Please review.

Project coverage is 80.62%. Comparing base (18b61e7) to head (6b372c6).

Files Patch % Lines
crates/wasmi/src/engine/executor/instrs.rs 68.46% 41 Missing :warning:
crates/wasmi/src/engine/executor/instrs/return_.rs 43.24% 21 Missing :warning:
crates/wasmi/src/engine/executor/instrs/store.rs 70.00% 3 Missing :warning:
crates/wasmi/src/engine/cache.rs 75.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1062 +/- ## ========================================== - Coverage 80.68% 80.62% -0.07% ========================================== Files 268 268 Lines 25009 24970 -39 ========================================== - Hits 20179 20131 -48 - Misses 4830 4839 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Robbepop commented 2 weeks ago

With Rust 1.79 this PR no longer has great effects on the benchmarks so I guess it is fine to merge it and have it as baseline for both https://github.com/wasmi-labs/wasmi/pull/1060 and https://github.com/wasmi-labs/wasmi/pull/1065.