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

Introduce ValueStackRef abstraction #459

Merged
merged 5 commits into from Sep 21, 2022
Merged

Introduce ValueStackRef abstraction #459

merged 5 commits into from Sep 21, 2022

Conversation

Robbepop
Copy link
Collaborator

This allows us to cache the stack_ptr with one fewer indirections for massive speedups across the board according to benchmarks I performed on my local machine.

This yielded significant performance improvemetns across the board.
Especially compute intense workloads displayed roughly 15-25% improvements in performance.
Host calls performance seemed to have regressed slightly.
This is somewhat cleaner and yields similar performance gains.
@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Sep 21, 2022

CRITERION BENCHMARKS

BENCHMARK MASTER PR Diff
compile_and_validate_v1 7.0136 ms 7.0864 ms ⚪ +0.9123%
execute_count_until_v1 3.9323 ms 3.0772 ms 🟢 -21.819%
execute_factorial_iterative_v1 2.0458 µs 1.6724 µs 🟢 -18.257%
execute_factorial_recursive_v1 2.3226 µs 2.3794 µs 🔴 +2.3845%
execute_fib_iterative_v1 12.221 ms 10.158 ms 🟢 -16.865%
execute_fib_recursive_v1 20.798 ms 21.174 ms ⚪ +2.5672%
execute_global_bump_v1 4.8491 ms 3.9275 ms 🟢 -17.057%
execute_host_calls_v1 33.730 µs 35.981 µs 🔴 +6.5037%
execute_memory_fill_v1 10.401 ms 9.3987 ms 🟢 -9.5809%
execute_memory_sum_v1 9.5572 ms 9.0792 ms 🟢 -4.7378%
execute_memory_vec_add_v1 18.955 ms 16.358 ms 🟢 -13.615%
execute_recursive_is_even_v1 3.3499 ms 3.5911 ms 🔴 +7.1904%
execute_recursive_ok_v1 409.79 µs 456.29 µs 🔴 +11.720%
execute_recursive_scan_v1 528.40 µs 565.07 µs 🔴 +6.2286%
execute_recursive_trap_v1 38.438 µs 43.610 µs 🔴 +14.906%
execute_regex_redux_v1 3.7412 ms 3.5105 ms 🟢 -6.3376%
execute_rev_complement_v1 3.6065 ms 3.0988 ms 🟢 -13.997%
execute_tiny_keccak_v1 3.1856 ms 2.7039 ms 🟢 -15.140%
execute_trunc_f2i_v1 4.3333 ms 3.9830 ms 🟢 -8.3653%
instantiate_v1 76.424 µs 77.532 µs ⚪ +0.8611%

Link to pipeline

@yjhmelody
Copy link
Contributor

Does it improve performance by reducing indirection address?

@Robbepop
Copy link
Collaborator Author

Does it improve performance by reducing indirection address?

yes, it is similar to the pc cache field.

@codecov-commenter
Copy link

Codecov Report

Merging #459 (e59264f) into master (115d308) will increase coverage by 0.03%.
The diff coverage is 93.56%.

@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
+ Coverage   79.42%   79.45%   +0.03%     
==========================================
  Files          71       73       +2     
  Lines        6198     6222      +24     
==========================================
+ Hits         4923     4944      +21     
- Misses       1275     1278       +3     
Impacted Files Coverage Δ
wasmi_v1/src/engine/stack/mod.rs 79.10% <ø> (ø)
wasmi_v1/src/engine/stack/values/mod.rs 84.12% <84.12%> (ø)
wasmi_v1/src/engine/stack/values/vref.rs 98.43% <98.43%> (ø)
wasmi_v1/src/engine/executor.rs 98.41% <100.00%> (+0.01%) ⬆️
wasmi_v1/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 marked this pull request as ready for review September 21, 2022 14:30
@Robbepop Robbepop merged commit 78bf98a into master Sep 21, 2022
@Robbepop Robbepop deleted the rf-stack-ptr-v2 branch September 21, 2022 14: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

4 participants