Skip to content
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

Add Wasm load and store API to UntypedValue #608

Merged
merged 4 commits into from
Jan 8, 2023

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Jan 8, 2023

Nearly all other Wasm operations are already included in the UntypedValue API but store and load operations were still missing. This will help to reduce code duplication especially if more wasmi engine backends and routines are added over time. Also this shifts some code from the bloated wasmi crate over to the more lightweight wasmi_core crate.

@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Jan 8, 2023

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.37ms 1.34ms 🔴 -2.24% 1.12ms 1.20ms 🔴 6.92% 🟢 -10%
execute/
bare_call_0/typed
972.23µs 983.17µs 🔴 1.21% 718.80µs 754.11µs 🔴 4.79% 🟢 -23%
execute/
bare_call_1
1.48ms 1.42ms 🔴 -4.11% 1.35ms 1.48ms 🔴 10.05% 🟢 5%
execute/
bare_call_16
2.51ms 2.45ms 🔴 -2.30% 4.20ms 4.25ms 🟢 1.19% 🟡 73%
execute/
bare_call_16/typed
1.59ms 1.64ms 🔴 2.78% 2.33ms 2.28ms 🟢 -2.15% 🟢 39%
execute/
bare_call_1/typed
1.06ms 1.08ms 🔴 1.43% 1.08ms 1.17ms 🔴 7.96% 🟢 8%
execute/
bare_call_4
1.55ms 1.62ms 🔴 3.88% 1.97ms 2.06ms 🔴 4.77% 🟢 27%
execute/
bare_call_4/typed
1.14ms 1.09ms 🟢 -4.65% 1.18ms 1.16ms 🟢 -1.46% 🟢 6%
execute/
br_table
1.18ms 1.08ms 🟢 -8.44% 1.30ms 1.32ms 🔴 1.74% 🟢 22%
execute/
count_until
682.63µs 711.57µs 🔴 4.12% 2.29ms 2.24ms 🟢 -2.11% 🔴 214%
execute/
factorial_iterative
322.25µs 321.20µs ⚪ -0.09% 884.27µs 895.97µs ⚪ 1.12% 🔴 179%
execute/
factorial_recursive
642.34µs 641.38µs ⚪ -0.39% 1.51ms 1.68ms 🔴 10.84% 🔴 161%
execute/
fib_iterative
1.43ms 1.46ms 🔴 1.65% 4.65ms 4.56ms 🟢 -1.88% 🔴 213%
execute/
fib_recursive
5.90ms 5.80ms 🟢 -1.80% 13.27ms 15.11ms 🔴 13.80% 🔴 161%
execute/
global_bump
1.07ms 1.11ms 🔴 3.00% 3.21ms 3.35ms 🔴 4.22% 🔴 203%
execute/
global_const
718.77µs 733.29µs ⚪ 2.47% 2.49ms 2.53ms 🔴 1.52% 🔴 245%
execute/
host_calls
29.14µs 29.46µs ⚪ 1.04% 42.78µs 45.63µs 🔴 6.69% 🟡 55%
execute/
memory_fill
1.31ms 1.35ms 🔴 3.33% 4.14ms 4.15ms ⚪ 0.32% 🔴 208%
execute/
memory_sum
1.31ms 1.32ms ⚪ 0.69% 4.22ms 4.13ms 🟢 -1.75% 🔴 213%
execute/
memory_vec_add
2.66ms 2.82ms 🔴 5.86% 8.57ms 8.96ms 🔴 4.59% 🔴 218%
execute/
recursive_is_even
1.16ms 1.13ms 🟢 -3.13% 2.35ms 2.73ms 🔴 16.15% 🔴 143%
execute/
recursive_ok
143.09µs 144.09µs ⚪ 0.82% 337.97µs 376.52µs 🔴 11.36% 🔴 161%
execute/
recursive_scan
179.67µs 181.16µs ⚪ 0.73% 443.73µs 485.12µs 🔴 12.93% 🔴 168%
execute/
recursive_trap
14.14µs 14.29µs ⚪ 0.94% 31.80µs 38.41µs 🔴 21.17% 🔴 169%
execute/
regex_redux
581.34µs 576.94µs ⚪ -0.74% 1.56ms 1.70ms 🔴 9.07% 🔴 194%
execute/
rev_complement
508.85µs 534.31µs 🔴 4.92% 1.52ms 1.57ms 🔴 3.29% 🔴 194%
execute/
tiny_keccak
363.12µs 376.20µs 🔴 3.41% 1.24ms 1.26ms ⚪ 0.57% 🔴 234%
execute/
trunc_f2i
916.79µs 909.94µs ⚪ -0.55% 2.63ms 2.54ms 🟢 -3.89% 🔴 179%
instantiate/
wasm_kernel
58.44µs 60.64µs 🔴 6.00% 71.66µs 71.68µs ⚪ 2.04% 🟢 18%
translate/
erc1155
213.46µs 208.30µs 🟢 -1.87% 402.29µs 403.62µs ⚪ -0.27% 🟡 94%
translate/
erc20
104.08µs 102.39µs 🟢 -1.51% 196.05µs 199.44µs 🔴 1.67% 🟡 95%
translate/
erc721
150.09µs 147.64µs 🟢 -2.04% 287.79µs 286.72µs ⚪ -0.47% 🟡 94%
translate/
spidermonkey
0.00ns 0.00ns ⚪ -1.39% 0.00ns 0.00ns ⚪ 0.38% 🟢 0%
translate/
wasm_kernel
3.89ms 3.87ms ⚪ -0.50% 7.68ms 7.61ms ⚪ -0.79% 🟡 96%

Link to pipeline

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2023

Codecov Report

Merging #608 (edbd3cd) into master (d2069ce) will increase coverage by 0.12%.
The diff coverage is 97.45%.

@@            Coverage Diff             @@
##           master     #608      +/-   ##
==========================================
+ Coverage   80.85%   80.98%   +0.12%     
==========================================
  Files          82       82              
  Lines        6702     6758      +56     
==========================================
+ Hits         5419     5473      +54     
- Misses       1283     1285       +2     
Impacted Files Coverage Δ
crates/wasmi/src/engine/executor.rs 97.84% <90.90%> (-0.35%) ⬇️
crates/core/src/untyped.rs 96.42% <100.00%> (+0.88%) ⬆️
crates/wasmi/src/engine/cache.rs 82.71% <100.00%> (-2.55%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Robbepop Robbepop merged commit f4aabf3 into master Jan 8, 2023
@Robbepop Robbepop deleted the rf-untyped-value-load-store branch January 8, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants