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

Avoid updating instr_ptr for tail calls #785

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Conversation

Robbepop
Copy link
Member

This avoids updating the instruction pointer of the current call frame upon a tail call since this call frame is going to be discarded upon a tail call.

This avoids updating the instruction pointer of the current call frame upon a tail call since this call frame is going to be discarded upon a tail call.
@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.53ms 1.55ms 🔴 1.87% 1.09ms 1.15ms 🔴 5.93% 🟢 -26%
execute/
bare_call_0/typed
1.17ms 1.17ms ⚪ -0.26% 751.71µs 783.83µs 🔴 4.37% 🟢 -33%
execute/
bare_call_1
1.59ms 1.60ms ⚪ 0.45% 1.27ms 1.33ms 🔴 4.48% 🟢 -17%
execute/
bare_call_16
2.56ms 2.52ms ⚪ -1.45% 3.30ms 3.30ms 🔴 0.62% 🟢 31%
execute/
bare_call_16/typed
1.56ms 1.57ms ⚪ 0.64% 1.87ms 1.94ms 🔴 3.79% 🟢 24%
execute/
bare_call_1/typed
1.25ms 1.25ms ⚪ -0.09% 1.11ms 1.14ms 🔴 2.98% 🟢 -9%
execute/
bare_call_4
1.81ms 1.77ms ⚪ -2.06% 1.69ms 1.73ms 🔴 2.21% 🟢 -2%
execute/
bare_call_4/typed
1.22ms 1.23ms ⚪ 0.81% 1.04ms 1.08ms 🔴 3.32% 🟢 -12%
execute/
br_table
1.37ms 1.34ms 🟢 -2.31% 1.26ms 1.27ms 🔴 1.53% 🟢 -5%
execute/
count_until
575.62µs 651.65µs 🔴 13.06% 1.29ms 1.30ms ⚪ 0.14% 🟡 99%
execute/
factorial_iterative
319.16µs 322.38µs ⚪ 0.87% 581.79µs 587.59µs ⚪ 0.98% 🟡 82%
execute/
factorial_recursive
496.94µs 490.72µs 🟢 -1.33% 770.17µs 762.58µs ⚪ -1.03% 🟡 55%
execute/
fibonacci_iter
1.40ms 1.40ms ⚪ 0.48% 2.81ms 2.80ms ⚪ -0.21% 🟡 99%
execute/
fibonacci_rec
4.10ms 3.99ms 🟢 -2.60% 6.67ms 6.67ms ⚪ -0.20% 🟡 67%
execute/
fibonacci_tail
867.29µs 883.70µs 🔴 1.88% 1.64ms 1.64ms ⚪ -0.03% 🟡 85%
execute/
global_bump
778.73µs 743.48µs 🟢 -4.60% 1.69ms 1.69ms ⚪ 0.08% 🔴 127%
execute/
global_const
681.15µs 662.08µs 🟢 -2.75% 1.33ms 1.33ms ⚪ -0.04% 🔴 101%
execute/
host_calls
37.16µs 37.20µs ⚪ -0.89% 41.04µs 41.14µs ⚪ 0.68% 🟢 11%
execute/
memory_fill
1.21ms 1.22ms ⚪ 2.82% 2.45ms 2.45ms ⚪ -0.12% 🔴 101%
execute/
memory_sum
1.14ms 1.18ms 🔴 4.20% 2.51ms 2.47ms 🟢 -1.61% 🔴 109%
execute/
memory_vec_add
2.36ms 2.36ms ⚪ -0.06% 5.26ms 5.33ms 🔴 1.26% 🔴 126%
execute/
recursive_is_even
663.28µs 668.31µs ⚪ 0.30% 1.14ms 1.14ms ⚪ 0.03% 🟡 70%
execute/
recursive_ok
94.84µs 94.97µs ⚪ 0.37% 170.12µs 170.81µs ⚪ 0.36% 🟡 80%
execute/
recursive_scan
130.82µs 130.26µs ⚪ -0.43% 229.82µs 229.18µs ⚪ -0.28% 🟡 76%
execute/
recursive_trap
8.86µs 8.95µs ⚪ 0.73% 17.27µs 17.18µs ⚪ -0.49% 🟡 92%
execute/
regex_redux
455.70µs 460.55µs ⚪ 0.97% 890.95µs 906.53µs 🔴 1.80% 🟡 97%
execute/
rev_complement
424.06µs 426.23µs ⚪ 0.32% 863.57µs 868.74µs ⚪ 0.64% 🔴 104%
execute/
tiny_keccak
335.11µs 341.74µs 🔴 1.88% 663.77µs 666.42µs ⚪ 0.51% 🟡 95%
execute/
trunc_f2i
731.62µs 743.61µs ⚪ 1.49% 1.72ms 1.72ms ⚪ 0.33% 🔴 132%
instantiate/
wasm_kernel
53.10µs 55.30µs ⚪ 3.27% 54.10µs 56.19µs ⚪ 1.48% 🟢 2%
translate/
erc1155
215.09µs 213.79µs ⚪ -0.79% 363.03µs 355.37µs 🟢 -1.98% 🟡 66%
translate/
erc20
105.32µs 104.84µs ⚪ -0.46% 176.69µs 172.95µs 🟢 -1.96% 🟡 65%
translate/
erc721
149.52µs 149.47µs ⚪ 0.52% 256.29µs 249.37µs 🟢 -2.50% 🟡 67%
translate/
spidermonkey
67.03ms 66.94ms ⚪ 0.08% 0.00ns 0.00ns ⚪ -0.79% 🟢 -100%
translate/
wasm_kernel
4.41ms 4.48ms 🔴 1.70% 6.54ms 6.52ms ⚪ 0.18% 🟢 45%

Link to pipeline

@codecov-commenter
Copy link

Codecov Report

Merging #785 (de3a65e) into master (b7a3ef4) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #785      +/-   ##
==========================================
- Coverage   81.14%   81.13%   -0.02%     
==========================================
  Files         270      270              
  Lines       23217    23209       -8     
==========================================
- Hits        18840    18831       -9     
- Misses       4377     4378       +1     
Files Coverage Δ
...s/wasmi/src/engine/regmach/executor/instrs/call.rs 72.83% <ø> (+0.22%) ⬆️
crates/wasmi/src/engine/executor.rs 80.09% <0.00%> (-0.22%) ⬇️

... and 2 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@Robbepop Robbepop merged commit 194359f into master Nov 13, 2023
18 checks passed
@Robbepop Robbepop deleted the rf-opt-tail-calls branch November 13, 2023 12:44
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