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

Move Value from wasmi_core to wasmi crate #636

Merged
merged 2 commits into from
Jan 25, 2023
Merged

Conversation

Robbepop
Copy link
Member

This is required for the implementation of the reference-types Wasm proposal since (according to the Wasmtime API) it adds two new variants to the Value type, which are:

enum Value {
    FuncRef(Option<Func>),
    ExternRef(Option<ExternRef>),
}

Since Func resides in wasmi we need to pull the Value type into the wasmi crate.

@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.34ms 1.34ms ⚪ -0.21% 1.10ms 1.15ms 🔴 4.60% 🟢 -14%
execute/
bare_call_0/typed
1.02ms 1.02ms ⚪ 0.01% 748.93µs 743.77µs ⚪ -0.92% 🟢 -27%
execute/
bare_call_1
1.41ms 1.41ms 🟢 0.11% 1.26ms 1.33ms 🔴 4.61% 🟢 -6%
execute/
bare_call_16
2.43ms 2.25ms 🟢 -7.50% 4.22ms 4.24ms 🔴 0.34% 🟡 88%
execute/
bare_call_16/typed
1.95ms 1.84ms 🟢 -5.48% 2.65ms 2.69ms 🔴 1.67% 🟢 46%
execute/
bare_call_1/typed
1.13ms 1.12ms ⚪ -0.13% 1.11ms 1.09ms ⚪ -0.03% 🟢 -3%
execute/
bare_call_4
1.82ms 1.55ms 🟢 -14.38% 1.89ms 1.92ms 🔴 1.49% 🟢 24%
execute/
bare_call_4/typed
1.14ms 1.13ms ⚪ -0.77% 1.22ms 1.27ms 🔴 3.76% 🟢 12%
execute/
br_table
1.22ms 1.21ms ⚪ 1.41% 1.35ms 1.36ms ⚪ 0.19% 🟢 12%
execute/
count_until
681.94µs 651.11µs 🟢 -4.54% 2.09ms 2.15ms 🔴 2.56% 🔴 230%
execute/
factorial_iterative
318.39µs 318.26µs ⚪ -0.08% 918.36µs 908.69µs ⚪ -1.17% 🔴 186%
execute/
factorial_recursive
627.92µs 670.20µs 🔴 6.65% 1.31ms 1.34ms 🔴 2.60% 🔴 101%
execute/
fib_iterative
1.41ms 1.41ms ⚪ -0.19% 5.04ms 5.05ms ⚪ 0.34% 🔴 259%
execute/
fib_recursive
5.85ms 5.70ms 🟢 -2.45% 11.60ms 11.68ms ⚪ 0.65% 🔴 105%
execute/
global_bump
1.06ms 1.04ms 🟢 -2.31% 2.78ms 2.78ms ⚪ 0.09% 🔴 167%
execute/
global_const
686.89µs 769.63µs 🔴 12.00% 2.12ms 2.30ms 🔴 9.11% 🔴 198%
execute/
host_calls
25.83µs 25.78µs ⚪ 0.37% 37.00µs 36.67µs ⚪ -0.91% 🟢 42%
execute/
memory_fill
1.24ms 1.20ms 🟢 -3.88% 4.09ms 4.08ms ⚪ 0.22% 🔴 241%
execute/
memory_sum
1.24ms 1.19ms 🟢 -3.56% 3.93ms 3.93ms ⚪ 0.04% 🔴 230%
execute/
memory_vec_add
2.46ms 2.37ms 🟢 -3.41% 7.87ms 7.88ms ⚪ -0.08% 🔴 232%
execute/
recursive_is_even
1.16ms 1.13ms 🟢 -3.35% 2.18ms 2.17ms ⚪ -0.62% 🟡 92%
execute/
recursive_ok
153.05µs 144.30µs 🟢 -5.76% 300.88µs 302.54µs ⚪ 0.00% 🔴 110%
execute/
recursive_scan
186.65µs 180.20µs 🟢 -3.33% 389.52µs 391.91µs ⚪ 0.57% 🔴 117%
execute/
recursive_trap
14.08µs 14.71µs 🔴 4.52% 29.34µs 30.63µs 🔴 4.32% 🔴 108%
execute/
regex_redux
526.09µs 528.31µs ⚪ 0.41% 1.41ms 1.41ms ⚪ 0.23% 🔴 167%
execute/
rev_complement
474.62µs 468.53µs ⚪ -1.19% 1.43ms 1.43ms ⚪ -0.01% 🔴 205%
execute/
tiny_keccak
332.73µs 337.53µs 🔴 1.55% 1.17ms 1.17ms ⚪ -0.31% 🔴 245%
execute/
trunc_f2i
700.84µs 704.92µs ⚪ 0.57% 2.19ms 2.18ms ⚪ -0.57% 🔴 209%
instantiate/
wasm_kernel
63.75µs 64.64µs ⚪ 0.87% 82.41µs 84.62µs ⚪ 1.66% 🟢 31%
translate/
erc1155
206.92µs 207.13µs ⚪ 0.18% 378.64µs 393.22µs 🔴 3.85% 🟡 90%
translate/
erc20
101.93µs 100.81µs ⚪ -0.98% 183.81µs 191.45µs 🔴 4.16% 🟡 90%
translate/
erc721
145.11µs 144.72µs ⚪ -0.32% 268.25µs 276.90µs 🔴 3.24% 🟡 91%
translate/
spidermonkey
0.00ns 0.00ns ⚪ 0.71% 0.00ns 0.00ns 🔴 2.84% 🟢 0%
translate/
wasm_kernel
3.80ms 3.83ms ⚪ 0.46% 7.15ms 7.36ms 🔴 2.68% 🟡 92%

Link to pipeline

@codecov-commenter
Copy link

Codecov Report

Merging #636 (14f4254) into master (5f9d81a) will decrease coverage by 0.02%.
The diff coverage is 38.88%.

@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
- Coverage   78.50%   78.48%   -0.02%     
==========================================
  Files          85       86       +1     
  Lines        7270     7270              
==========================================
- Hits         5707     5706       -1     
- Misses       1563     1564       +1     
Impacted Files Coverage Δ
crates/cli/src/main.rs 0.00% <ø> (ø)
crates/core/src/untyped.rs 97.21% <ø> (-0.09%) ⬇️
crates/core/src/value.rs 74.74% <ø> (+12.42%) ⬆️
crates/wasmi/src/engine/func_builder/mod.rs 86.40% <ø> (ø)
crates/wasmi/src/engine/resumable.rs 81.13% <ø> (ø)
crates/wasmi/src/engine/traits.rs 80.00% <ø> (ø)
crates/wasmi/src/func/mod.rs 77.52% <ø> (ø)
crates/wasmi/src/func_type.rs 96.61% <ø> (ø)
crates/wasmi/src/global.rs 46.75% <ø> (ø)
crates/wasmi/src/module/init_expr.rs 45.61% <ø> (ø)
... and 7 more

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

@Robbepop Robbepop merged commit 90019d1 into master Jan 25, 2023
@Robbepop Robbepop deleted the rf-move-value-to-wasmi branch January 25, 2023 21:51
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