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

Optimize memory.{load,store} for when reading or writing single bytes #689

Merged
merged 9 commits into from Mar 1, 2023

Conversation

Robbepop
Copy link
Collaborator

No description provided.

@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Feb 22, 2023

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.51ms 1.51ms 🔴 -0.05% 1.35ms 1.43ms 🔴 6.02% 🟢 -5%
execute/
bare_call_0/typed
1.11ms 1.13ms 🔴 1.96% 979.65µs 977.18µs ⚪ -0.40% 🟢 -14%
execute/
bare_call_1
1.55ms 1.56ms 🟢 0.20% 1.39ms 1.48ms 🔴 6.49% 🟢 -5%
execute/
bare_call_16
2.42ms 2.42ms 🟢 -0.20% 3.42ms 3.44ms ⚪ 0.33% 🟢 42%
execute/
bare_call_16/typed
1.87ms 1.81ms 🟢 -3.14% 1.64ms 1.62ms ⚪ -1.17% 🟢 -10%
execute/
bare_call_1/typed
1.22ms 1.23ms ⚪ 0.44% 1.26ms 1.25ms ⚪ -0.71% 🟢 2%
execute/
bare_call_4
1.73ms 1.80ms 🔴 4.46% 1.80ms 1.82ms 🟢 0.85% 🟢 1%
execute/
bare_call_4/typed
1.26ms 1.31ms 🔴 3.07% 1.23ms 1.19ms 🟢 -3.19% 🟢 -9%
execute/
br_table
1.32ms 1.34ms 🔴 2.22% 1.39ms 1.43ms 🔴 2.69% 🟢 6%
execute/
count_until
716.32µs 709.35µs ⚪ -0.83% 988.41µs 1.01ms 🔴 2.21% 🟢 43%
execute/
factorial_iterative
366.38µs 335.96µs 🟢 -8.29% 437.51µs 459.85µs 🔴 5.01% 🟢 37%
execute/
factorial_recursive
586.22µs 589.22µs ⚪ 0.53% 911.61µs 853.85µs 🟢 -6.52% 🟢 45%
execute/
fibonacci_iter
1.47ms 1.46ms ⚪ -0.10% 2.06ms 2.07ms ⚪ 0.29% 🟢 41%
execute/
fibonacci_rec
4.77ms 4.90ms 🔴 2.85% 7.42ms 7.27ms 🟢 -1.80% 🟢 48%
execute/
fibonacci_tail
1.17ms 1.18ms ⚪ 0.22% 1.57ms 1.56ms ⚪ -0.38% 🟢 33%
execute/
global_bump
780.96µs 806.86µs 🔴 3.41% 1.32ms 1.35ms 🔴 1.78% 🟡 67%
execute/
global_const
808.01µs 718.13µs 🟢 -11.15% 1.17ms 1.17ms ⚪ -0.34% 🟡 63%
execute/
host_calls
36.39µs 35.71µs ⚪ -1.32% 46.16µs 50.95µs 🔴 10.36% 🟢 43%
execute/
memory_fill
1.21ms 1.25ms 🔴 3.60% 1.76ms 1.77ms ⚪ 0.94% 🟢 42%
execute/
memory_sum
1.21ms 1.19ms ⚪ -1.58% 1.80ms 1.79ms ⚪ -0.93% 🟡 51%
execute/
memory_vec_add
2.39ms 2.38ms ⚪ -0.50% 4.19ms 3.84ms 🟢 -8.60% 🟡 62%
execute/
recursive_is_even
1.04ms 1.02ms ⚪ -1.58% 1.68ms 1.70ms ⚪ 2.21% 🟡 67%
execute/
recursive_ok
121.38µs 121.25µs ⚪ -0.09% 194.69µs 189.78µs 🟢 -2.59% 🟡 57%
execute/
recursive_scan
157.71µs 156.75µs ⚪ -0.74% 241.40µs 239.21µs ⚪ -0.82% 🟡 53%
execute/
recursive_trap
12.66µs 12.42µs 🟢 -2.00% 20.63µs 20.68µs ⚪ 0.34% 🟡 67%
execute/
regex_redux
500.93µs 497.88µs ⚪ -0.35% 821.03µs 814.77µs ⚪ -0.97% 🟡 64%
execute/
rev_complement
456.83µs 458.32µs ⚪ 0.24% 725.10µs 718.36µs ⚪ -0.84% 🟡 57%
execute/
tiny_keccak
342.27µs 325.18µs 🟢 -4.85% 545.77µs 548.51µs ⚪ 0.54% 🟡 69%
execute/
trunc_f2i
787.57µs 776.62µs 🟢 -1.29% 1.37ms 1.46ms 🔴 6.91% 🟡 88%
instantiate/
wasm_kernel
51.79µs 51.68µs ⚪ -0.03% 58.25µs 56.43µs 🟢 -2.80% 🟢 9%
translate/
erc1155
235.84µs 234.66µs ⚪ -0.24% 441.55µs 449.61µs 🔴 1.80% 🟡 92%
translate/
erc20
115.17µs 113.97µs ⚪ -1.02% 215.45µs 217.79µs ⚪ 1.07% 🟡 91%
translate/
erc721
163.85µs 161.67µs ⚪ -1.21% 312.81µs 314.84µs ⚪ 0.41% 🟡 95%
translate/
spidermonkey
0.00ns 0.00ns ⚪ -0.32% 0.00ns 0.00ns ⚪ 0.96% 🟢 0%
translate/
wasm_kernel
4.12ms 4.08ms ⚪ -0.99% 8.03ms 8.11ms ⚪ 1.34% 🟡 99%

Link to pipeline

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2023

Codecov Report

Merging #689 (4c7129c) into master (43f525c) will increase coverage by 0.05%.
The diff coverage is 96.61%.

@@            Coverage Diff             @@
##           master     #689      +/-   ##
==========================================
+ Coverage   81.01%   81.06%   +0.05%     
==========================================
  Files         100      100              
  Lines        8489     8526      +37     
==========================================
+ Hits         6877     6912      +35     
- Misses       1612     1614       +2     
Impacted Files Coverage Δ
crates/core/src/value.rs 78.22% <96.15%> (+4.75%) ⬆️
crates/core/src/untyped.rs 97.10% <100.00%> (-0.11%) ⬇️

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

@Robbepop
Copy link
Collaborator Author

Benchmarks show either no change or significant regressions for Wasm builds. Closed.

@Robbepop Robbepop closed this Feb 22, 2023
@Robbepop Robbepop changed the title Optimize memory accesses Experimental: Optimize memory accesses Feb 22, 2023
@Robbepop Robbepop reopened this Mar 1, 2023
@Robbepop Robbepop changed the title Experimental: Optimize memory accesses Experimental: Optimize memory.{load,store} for when reading or writing single bytes Mar 1, 2023
@Robbepop Robbepop changed the title Experimental: Optimize memory.{load,store} for when reading or writing single bytes Optimize memory.{load,store} for when reading or writing single bytes Mar 1, 2023
@Robbepop Robbepop merged commit 166440d into master Mar 1, 2023
@Robbepop Robbepop deleted the rf-opt-memory branch March 1, 2023 15:47
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