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

Refactor Linker for preparation of Linker::func_{wrap,new} methods #681

Merged
merged 15 commits into from Feb 15, 2023

Conversation

Robbepop
Copy link
Collaborator

cc @flavio

This method does also not exist in the Wasmtime Linker API.
From the Wasmtime API.
This is going to be important for planned Linker::func_new and Linker::func_wrap methods.
This assertion revealed some bugs in our own testsuite.
This will allow us to define Linker-owned host functions later. Most part of the commit was to properly implement Debug for Linker.
Also rename resolve to get.
@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.45ms 1.85ms 🔴 27.61% 1.23ms 1.28ms 🔴 3.34% 🟢 -31%
execute/
bare_call_0/typed
1.05ms 1.13ms 🔴 6.60% 850.82µs 870.48µs 🔴 1.99% 🟢 -23%
execute/
bare_call_1
1.50ms 1.79ms 🔴 19.44% 1.41ms 1.46ms 🔴 3.15% 🟢 -19%
execute/
bare_call_16
2.35ms 2.36ms 🔴 1.01% 4.17ms 4.29ms 🔴 2.87% 🟡 82%
execute/
bare_call_16/typed
1.58ms 1.70ms 🔴 6.46% 2.36ms 2.33ms 🟢 -1.27% 🟢 38%
execute/
bare_call_1/typed
1.15ms 1.16ms ⚪ 0.66% 1.26ms 1.27ms ⚪ 1.07% 🟢 9%
execute/
bare_call_4
1.62ms 1.62ms 🔴 0.34% 1.90ms 1.95ms 🔴 2.40% 🟢 20%
execute/
bare_call_4/typed
1.15ms 1.23ms 🔴 6.98% 1.37ms 1.39ms 🔴 1.51% 🟢 12%
execute/
br_table
1.18ms 1.16ms ⚪ -1.46% 1.50ms 1.49ms ⚪ -0.69% 🟢 28%
execute/
count_until
641.60µs 651.91µs 🔴 1.56% 2.29ms 2.27ms ⚪ -0.98% 🔴 248%
execute/
factorial_iterative
317.93µs 317.99µs ⚪ 0.13% 959.66µs 939.06µs 🟢 -2.05% 🔴 195%
execute/
factorial_recursive
645.65µs 648.96µs ⚪ 0.49% 1.30ms 1.30ms ⚪ 0.03% 🔴 101%
execute/
fib_iterative
1.41ms 1.41ms ⚪ 0.22% 5.48ms 5.16ms ⚪ -3.15% 🔴 266%
execute/
fib_recursive
5.89ms 5.99ms 🔴 1.80% 11.62ms 11.25ms 🟢 -3.04% 🟡 88%
execute/
global_bump
1.04ms 1.04ms ⚪ -0.80% 2.71ms 2.52ms 🟢 -6.87% 🔴 142%
execute/
global_const
684.76µs 686.45µs ⚪ 0.20% 2.42ms 2.57ms 🔴 5.80% 🔴 274%
execute/
host_calls
27.86µs 27.52µs ⚪ -1.63% 39.64µs 41.90µs 🔴 6.18% 🟡 52%
execute/
memory_fill
1.20ms 1.19ms ⚪ -0.15% 4.32ms 4.20ms ⚪ -2.26% 🔴 251%
execute/
memory_sum
1.19ms 1.19ms ⚪ 0.58% 4.29ms 4.14ms 🟢 -2.78% 🔴 248%
execute/
memory_vec_add
2.42ms 2.39ms 🟢 -1.13% 7.79ms 7.75ms ⚪ -0.47% 🔴 224%
execute/
recursive_is_even
1.17ms 1.17ms ⚪ 0.56% 2.40ms 2.28ms 🟢 -4.11% 🟡 95%
execute/
recursive_ok
152.79µs 175.33µs 🔴 13.05% 306.27µs 306.84µs ⚪ 0.31% 🟡 75%
execute/
recursive_scan
183.30µs 202.65µs 🔴 12.14% 378.49µs 375.43µs ⚪ -0.47% 🟡 85%
execute/
recursive_trap
15.48µs 15.29µs ⚪ -1.52% 30.87µs 30.96µs ⚪ 0.22% 🔴 102%
execute/
regex_redux
534.16µs 533.41µs ⚪ -0.48% 1.39ms 1.38ms ⚪ -0.92% 🔴 158%
execute/
rev_complement
481.98µs 463.30µs ⚪ -11.74% 1.42ms 1.42ms ⚪ -0.03% 🔴 206%
execute/
tiny_keccak
328.71µs 324.82µs ⚪ -1.06% 1.15ms 1.14ms ⚪ -0.32% 🔴 252%
execute/
trunc_f2i
694.03µs 721.41µs 🔴 3.86% 2.14ms 2.13ms ⚪ -0.86% 🔴 195%
instantiate/
wasm_kernel
65.04µs 64.83µs ⚪ -2.54% 72.72µs 71.23µs 🟢 -2.13% 🟢 10%
translate/
erc1155
244.21µs 233.88µs 🟢 -4.49% 472.95µs 453.76µs 🟢 -3.99% 🟡 94%
translate/
erc20
116.52µs 113.87µs ⚪ -2.02% 227.19µs 218.88µs 🟢 -3.89% 🟡 92%
translate/
erc721
163.16µs 161.57µs ⚪ -0.75% 332.60µs 318.99µs 🟢 -4.03% 🟡 97%
translate/
spidermonkey
0.00ns 0.00ns ⚪ -1.22% 0.00ns 0.00ns 🟢 -3.03% 🟢 0%
translate/
wasm_kernel
4.05ms 4.04ms ⚪ -0.19% 8.53ms 8.28ms 🟢 -2.97% 🔴 105%

Link to pipeline

@codecov-commenter
Copy link

Codecov Report

Merging #681 (c26b680) into master (29e6b37) will decrease coverage by 0.15%.
The diff coverage is 79.23%.

@@            Coverage Diff             @@
##           master     #681      +/-   ##
==========================================
- Coverage   81.20%   81.05%   -0.15%     
==========================================
  Files         100      100              
  Lines        8439     8478      +39     
==========================================
+ Hits         6853     6872      +19     
- Misses       1586     1606      +20     
Impacted Files Coverage Δ
crates/cli/src/context.rs 0.00% <0.00%> (ø)
crates/wasmi/src/store.rs 75.30% <ø> (+0.61%) ⬆️
crates/wasmi/src/linker.rs 53.29% <38.46%> (-4.54%) ⬇️
crates/wasmi/src/func/mod.rs 80.70% <90.90%> (+1.07%) ⬆️
crates/wasi/tests/wasi_wat.rs 100.00% <100.00%> (ø)
crates/wasmi/src/engine/mod.rs 81.63% <100.00%> (+0.18%) ⬆️
crates/wasmi/src/engine/stack/frames.rs 100.00% <100.00%> (ø)
crates/wasmi/src/engine/tests.rs 99.33% <100.00%> (ø)
crates/wasmi/src/module/instantiate/tests.rs 98.30% <100.00%> (ø)
crates/wasmi/tests/e2e/v1/fuel_metering.rs 100.00% <100.00%> (ø)
... and 5 more

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

@Robbepop Robbepop merged commit b23cf0c into master Feb 15, 2023
@Robbepop Robbepop deleted the rf-refactor-linker branch February 15, 2023 16:30
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.

None yet

3 participants