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

Experimental: Optimize internal ValueStack by introducing a ValueStackPtr type #688

Merged
merged 56 commits into from
Feb 23, 2023

Conversation

Robbepop
Copy link
Member

No description provided.

@Robbepop Robbepop changed the title Optimize internal ValueStackRef type Experimental: Optimize internal ValueStackRef type Feb 21, 2023
@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Feb 21, 2023

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.47ms 1.44ms 🟢 -2.58% 1.26ms 1.09ms 🟢 -13.36% 🟢 -24%
execute/
bare_call_0/typed
1.04ms 1.02ms 🟢 -2.39% 749.14µs 731.98µs 🟢 -2.20% 🟢 -28%
execute/
bare_call_1
1.51ms 1.48ms 🟢 -1.96% 1.43ms 1.22ms 🟢 -13.91% 🟢 -17%
execute/
bare_call_16
2.35ms 2.32ms 🟢 -1.00% 3.53ms 3.14ms 🟢 -10.95% 🟢 36%
execute/
bare_call_16/typed
1.59ms 1.57ms 🟢 -1.53% 1.64ms 1.48ms 🟢 -9.68% 🟢 -6%
execute/
bare_call_1/typed
1.16ms 1.13ms 🟢 -2.51% 1.28ms 978.80µs 🟢 -23.78% 🟢 -14%
execute/
bare_call_4
1.59ms 1.55ms 🟢 -2.37% 1.69ms 1.57ms 🟢 -6.99% 🟢 1%
execute/
bare_call_4/typed
1.15ms 1.11ms 🟢 -4.03% 1.05ms 1.01ms 🟢 -3.81% 🟢 -9%
execute/
br_table
1.19ms 1.18ms ⚪ 0.03% 1.48ms 1.20ms 🟢 -19.17% 🟢 1%
execute/
count_until
710.86µs 649.86µs 🟢 -8.53% 1.51ms 1.21ms 🟢 -19.97% 🟡 86%
execute/
factorial_iterative
315.43µs 326.42µs 🔴 3.39% 732.97µs 506.15µs 🟢 -31.03% 🟡 55%
execute/
factorial_recursive
637.66µs 652.38µs 🔴 2.28% 1.47ms 1.12ms 🟢 -23.32% 🟡 72%
execute/
fib_iterative
1.42ms 1.47ms 🔴 3.32% 3.49ms 2.45ms 🟢 -29.85% 🟡 67%
execute/
fib_recursive
5.90ms 5.93ms ⚪ 0.60% 12.15ms 9.85ms 🟢 -18.94% 🟡 66%
execute/
global_bump
1.04ms 956.97µs 🟢 -7.61% 2.54ms 2.32ms 🟢 -8.73% 🔴 142%
execute/
global_const
710.90µs 685.33µs 🟢 -3.66% 1.93ms 1.47ms 🟢 -23.73% 🔴 114%
execute/
host_calls
28.39µs 27.43µs 🟢 -3.05% 43.22µs 38.65µs 🟢 -10.37% 🟢 41%
execute/
memory_fill
1.31ms 1.20ms 🟢 -8.44% 2.94ms 2.09ms 🟢 -28.98% 🟡 74%
execute/
memory_sum
1.24ms 1.21ms 🟢 -2.33% 2.82ms 2.13ms 🟢 -24.23% 🟡 75%
execute/
memory_vec_add
2.51ms 2.38ms 🟢 -4.95% 6.58ms 4.71ms 🟢 -28.48% 🟡 98%
execute/
recursive_is_even
1.16ms 1.15ms ⚪ -1.61% 2.08ms 2.13ms 🔴 2.25% 🟡 86%
execute/
recursive_ok
156.99µs 145.27µs 🟢 -7.18% 286.08µs 287.88µs ⚪ 0.49% 🟡 98%
execute/
recursive_scan
186.26µs 176.29µs 🟢 -5.88% 359.48µs 360.05µs ⚪ 0.15% 🔴 104%
execute/
recursive_trap
14.84µs 14.32µs 🟢 -3.25% 29.85µs 29.28µs 🟢 -2.03% 🔴 104%
execute/
regex_redux
532.12µs 559.13µs 🔴 5.15% 1.25ms 1.05ms 🟢 -16.43% 🟡 87%
execute/
rev_complement
478.59µs 468.78µs 🟢 -2.17% 1.07ms 847.99µs 🟢 -21.60% 🟡 81%
execute/
tiny_keccak
344.10µs 328.57µs 🟢 -4.66% 897.14µs 643.22µs 🟢 -28.15% 🟡 96%
execute/
trunc_f2i
711.30µs 786.19µs 🔴 10.48% 1.86ms 1.44ms 🟢 -22.92% 🟡 83%
instantiate/
wasm_kernel
54.34µs 53.20µs 🟢 -2.73% 56.78µs 57.45µs ⚪ 0.05% 🟢 8%
translate/
erc1155
234.97µs 234.52µs ⚪ 0.22% 452.07µs 447.43µs ⚪ -1.27% 🟡 91%
translate/
erc20
113.14µs 113.38µs ⚪ 0.18% 218.46µs 215.95µs ⚪ -1.20% 🟡 90%
translate/
erc721
161.06µs 161.70µs ⚪ 0.45% 317.83µs 314.18µs ⚪ -1.02% 🟡 94%
translate/
spidermonkey
0.00ns 0.00ns ⚪ 0.02% 0.00ns 0.00ns ⚪ -0.60% 🟢 0%
translate/
wasm_kernel
4.05ms 4.06ms ⚪ 0.21% 8.29ms 8.25ms ⚪ -0.81% 🔴 103%

Link to pipeline

@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2023

Codecov Report

Merging #688 (ad25645) into master (43f525c) will decrease coverage by 0.01%.
The diff coverage is 96.57%.

@@            Coverage Diff             @@
##           master     #688      +/-   ##
==========================================
- Coverage   81.01%   81.01%   -0.01%     
==========================================
  Files         100      100              
  Lines        8489     8510      +21     
==========================================
+ Hits         6877     6894      +17     
- Misses       1612     1616       +4     
Impacted Files Coverage Δ
crates/wasmi/src/engine/stack/mod.rs 81.81% <ø> (ø)
crates/wasmi/src/engine/stack/values/sp.rs 94.25% <94.25%> (ø)
crates/wasmi/src/engine/executor.rs 95.08% <100.00%> (-0.24%) ⬇️
crates/wasmi/src/engine/stack/values/mod.rs 87.17% <100.00%> (+2.10%) ⬆️
crates/wasmi/src/engine/stack/values/tests.rs 100.00% <100.00%> (ø)

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

@Robbepop Robbepop changed the title Experimental: Optimize internal ValueStackRef type Experimental: Optimize internal ValueStack by introducing a ValueStackPtr type Feb 22, 2023
@Robbepop
Copy link
Member Author

Robbepop commented Feb 23, 2023

I cannot explain the massive 10% performance regression on the execute/trunc_f2i test case, however, on the contrary we should probably still merge this PR due to the massive performance improvements across the board for Wasm builds and moderate performance wins on native for other test cases.

@Robbepop Robbepop merged commit 43ce25d into master Feb 23, 2023
@Robbepop Robbepop deleted the rf-opt-sp branch February 23, 2023 14:21
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