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

Inline reusable allocations #462

Merged
merged 3 commits into from Sep 22, 2022
Merged

Inline reusable allocations #462

merged 3 commits into from Sep 22, 2022

Conversation

Robbepop
Copy link
Collaborator

@Robbepop Robbepop commented Sep 22, 2022

This is an experiment to see whether the move overhead of storing reusable allocations by value outweights the indirection overhead of accessing them via reference. Locally I see no significant change in performance, however, so far it seems that the access via reference is by far simpler to setup and use and produces slightly more readable code imo.

These changes might also make it simpler to implement parallel parsing, validation and translation in future versions of wasmi. That means that all functions are parsed, validated and translated in parallel isolation. So far wasmi does not support parallel translation of functions since wasmi is primarily used by us as Wasm binary and Wasm does not (yet) support parallelism.

This is an experiment to see whether the move overhead of storing reusable allocations by value outweights the indirection overhead of accessing them via reference.
Locally I see no significant change in performance, however, so far it seems that the access via reference is by far simpler to setup and use and produces slightly more readable code imo.
@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Sep 22, 2022

CRITERION BENCHMARKS

BENCHMARK MASTER PR Diff
compile_and_validate_v1 6.5089 ms 6.4134 ms 🟢 -1.3908%
execute_count_until_v1 2.0792 ms 2.0752 ms ⚪ -0.1512%
execute_factorial_iterative_v1 1.6720 µs 1.6610 µs ⚪ -1.0263%
execute_factorial_recursive_v1 2.2286 µs 2.2161 µs ⚪ -0.7885%
execute_fib_iterative_v1 10.136 ms 10.143 ms ⚪ +0.0826%
execute_fib_recursive_v1 20.245 ms 20.274 ms ⚪ -0.0241%
execute_global_bump_v1 4.0059 ms 4.2101 ms 🔴 +7.9810%
execute_host_calls_v1 35.444 µs 37.116 µs 🔴 +5.6725%
execute_memory_fill_v1 8.4480 ms 8.4569 ms ⚪ +0.1612%
execute_memory_sum_v1 8.1805 ms 8.2532 ms ⚪ +0.7257%
execute_memory_vec_add_v1 15.211 ms 15.453 ms 🔴 +1.5848%
execute_recursive_is_even_v1 3.1978 ms 2.8409 ms 🟢 -10.767%
execute_recursive_ok_v1 426.68 µs 389.84 µs 🟢 -8.6657%
execute_recursive_scan_v1 544.41 µs 507.96 µs 🟢 -6.5318%
execute_recursive_trap_v1 40.507 µs 38.129 µs 🟢 -6.1956%
execute_regex_redux_v1 3.5149 ms 3.5158 ms ⚪ +0.0763%
execute_rev_complement_v1 3.0890 ms 3.0907 ms ⚪ +0.1152%
execute_tiny_keccak_v1 2.6719 ms 2.6795 ms ⚪ +0.2335%
execute_trunc_f2i_v1 3.9734 ms 3.9706 ms ⚪ -0.1456%
instantiate_v1 78.780 µs 77.414 µs ⚪ -1.6288%

Link to pipeline

@Robbepop Robbepop merged commit 41b8fb2 into master Sep 22, 2022
@Robbepop Robbepop deleted the rf-inline-allocations branch September 22, 2022 08:31
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

2 participants