Skip to content

Conversation

@bfdays
Copy link
Contributor

@bfdays bfdays commented Oct 10, 2025

No description provided.

bfdays and others added 13 commits October 6, 2025 17:54
…port stack values; perf graphs (flamgraph) to measure perfomance; generic impl for reusable pools (for ValueStack and CallStack); improved hashmaps perf by changing hash builder to a faster one; rewrote RwasmStore.(tables|global_variables) onto Vec for perfomance; unix-speciific memory pool optimization (#53)

* feat(segment-caching): simple BitVecInlined wrapper for BitVec

* feat(segment-caching): fix std error

* feat(segment-caching): fix bug, extend unit-test

* feat(segment-caching): implemented stack based BitVec (BitVecInlined) replacement and integrated into RwasmStore; measured perfomance of fibbonachi app execution on rwasm with perf and visualized with flamegraph; implemented benchmarks for BitVecInlined and fibonnachi app execution using

* feat(segment-caching): renamings for clarity

* feat(segment-caching): added load perfomance graph

* feat(segment-caching): fix std problem

* feat(segment-caching): updated flamegraphs

* feat(rwasm): implemented&integrated reusable pool for ValueStack

* feat(rwasm): implemented generic reusable pool and integrated for ValueStack and CallStack

* feat(rwasm): cleanup

* feat(rwasm): cleanup

* feat(rwasm): move reusable pools from RwasmStore to ExecutionEngineInner

* feat(rwasm): fix no-std issues + cleanup

* feat(rwasm): optimise perfomance of ValueStackPtr by making it repr(transparent)

* feat(rwasm): improve hashmap perf by replacing hash build with fnv::FnvBuildHasher; do not create elements with capacity in TableEntity for perfomance

* feat(rwasm): rewrote RwasmStore.tables onto Vec instead of hashmap for perfomance

* feat(rwasm): fix no-std issue

* feat(rwasm): rewrote RwasmStore.global_variables onto Vec instead of hashmap for perfomance

* feat(rwasm): cleanup

* feat(rwasm): optimised work with store.global_variables and store.tables for perfomance; added benches for Hashmap and Vec to compare perf

* feat(rwasm): fix bench

* feat(rwasm): perf fix

* feat(rwasm): cleanup

* feat(rwasm): added make test

* feat(rwasm): uncommented bitvec_inlined; cleanup

* feat(rwasm): fixes

* feat(rwasm): cover bitvec_inlined with feature

* feat(rwasm): fixed bug for RwasmStore.global_variables processing

* feat(rwasm): fixes to benches

* feat(rwasm): cleanup

* feat(rwasm): cleanup

* chore: add evm benchmarks

* feat(rwasm): removed 1 flame graph

* chore: add benchamrks for fib32/fib64

* feat(rwasm): added perf graph for bench_evm

* chore: fix running fib32 bench

* feat(rwasm): added perf graph for fib64

* feat(rwasm): added perf for fib64

* feat(rwasm): perf graph for fib64

* feat(rwasm): fix perf graph

* feat(rwasm): inline for some new alu methods; fix bench collission

* fix: fix running tests, optimized reusable stacks, put tests related functionality from value stack under flag

* feat(rwasm): fix bench group name

* chore: tiny fixes

* fix: add fib256 benches, fix missing virtual stack alloc for benches, fix project compilation in tracer mode, fix typo with global memory init with max possible capacity, fixed module serialization, add evm machine executor, add trace extractor for fib32, fib64, fib64 tests

* feat(rwasm): global memory implementation using unix low level optimisations

* feat(rwasm): renamings

* feat(rwasm): fix feature name

* feat(rwasm): file renaming

* feat(rwasm): added fib32 test as regular test for trials

---------

Co-authored-by: Dmitry Savonin <[email protected]>
…58)

* feat(rwasm-optimisation): global memory reusability

* feat(rwasm-optimisation): recycling global memory v1 (RwasmStore)

* feat(rwasm-optimisation): warmup for recycling global memory

* feat(rwasm-optimisation): small fixes

* feat(rwasm-optimisation): support fallback to BytesMut-based GlobalMemory in case if memory pool exhahusted

* feat(rwasm-optimisation): uncomment benches

* feat(rwasm-optimisation): renamings+ordering; fix probolem with fallback strategy

* feat(rwasm-optimisation): improved reusable pool; forked setjmp crate and removed check

* fix(pooilng-memory): enabled pooling memory by default, remove guard memory pages

* bench: add new benches for module parsing and compilation

---------

Co-authored-by: Dmitry Savonin <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 3 to 11.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](dawidd6/action-download-artifact@v3...v11)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-version: '11'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Oct 10, 2025

Criterion results (vs baseline)


running 2 tests
test tests::fib32_rwasm_test ... ignored
test tests::fib32_wasmtime_test ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s

Comparisons/bitvec      time:   [18.434 µs 18.445 µs 18.456 µs]
Found 22 outliers among 200 measurements (11.00%)
  4 (2.00%) high mild
  18 (9.00%) high severe
Comparisons/bitvec_inlined
                        time:   [3.4251 µs 3.4260 µs 3.4270 µs]
Found 32 outliers among 200 measurements (16.00%)
  9 (4.50%) low severe
  3 (1.50%) low mild
  11 (5.50%) high mild
  9 (4.50%) high severe
Comparisons/bitvec_inlined (half of inline store)
                        time:   [1.8663 µs 1.8696 µs 1.8741 µs]
Found 28 outliers among 200 measurements (14.00%)
  8 (4.00%) low severe
  2 (1.00%) low mild
  9 (4.50%) high mild
  9 (4.50%) high severe
RwasmModule {
 .function_begin_0 (#0)
  0000: StackCheck(5)
  0001: I32Const(1)
  0002: MemoryGrow
  0003: Drop
  0004: I32Const(0)
  0005: I32Const(0)
  0006: I32Const(80)
  0007: MemoryInit(0)
  0008: DataDrop(1)
  0009: ReturnCallInternal(10)
 .function_end

 .function_begin_10 (#1)
  0010: SignatureCheck(0)
  0011: ConsumeFuel(4)
  0012: StackCheck(4)
  0013: LocalGet(1)
  0014: LocalGet(1)
  0015: I32Load(4)
  0016: LocalGet(2)
  0017: I32Load(0)
  0018: LocalSet(2)
  0019: LocalGet(2)
  0020: LocalSet(3)
  0021: LocalGet(1)
  0022: LocalSet(2)
  0023: Drop
  0024: Return
 .function_end

 .ro_data: [61, 62, 63, 64, 65, 66, 67, 68, 69, 6a, 6b, 6c, 6d, 6e, 6f, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7a, 61, 62, 63, 64, 65, 66, 67, 68, 69, 6a, 6b, 6c, 6d, 6e, 6f, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7a, 61, 62, 63, 64, 65, 66, 67, 68, 69, 6a, 6b, 6c, 6d, 6e, 6f, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7a, 61, 62],
 .ro_elem: [],
}

Comparisons/bitvec_inlined (through ExecutionEngine)
                        time:   [3.3879 ms 3.3891 ms 3.3905 ms]
Found 12 outliers among 200 measurements (6.00%)
  8 (4.00%) high mild
  4 (2.00%) high severe

Comparisons Module Compilation/bench_evm
                        time:   [319.99 ns 320.20 ns 320.44 ns]
Found 8 outliers among 200 measurements (4.00%)
  2 (1.00%) low mild
  4 (2.00%) high mild
  2 (1.00%) high severe
Comparisons Module Compilation/bench_wasmtime
                        time:   [4.8618 ms 4.8633 ms 4.8649 ms]
Found 1 outliers among 200 measurements (0.50%)
  1 (0.50%) high severe
Comparisons Module Compilation/bench_wasmi
                        time:   [21.311 µs 21.563 µs 21.886 µs]
Found 8 outliers among 200 measurements (4.00%)
  8 (4.00%) high severe
Comparisons Module Compilation/bench_rwasm
                        time:   [26.601 µs 26.609 µs 26.618 µs]
Found 17 outliers among 200 measurements (8.50%)
  7 (3.50%) low severe
  2 (1.00%) high mild
  8 (4.00%) high severe

Comparisons Fib256/bench_native
                        time:   [41.280 ns 41.288 ns 41.296 ns]
Found 26 outliers among 200 measurements (13.00%)
  11 (5.50%) low severe
  4 (2.00%) low mild
  6 (3.00%) high mild
  5 (2.50%) high severe
Comparisons Fib256/bench_evm
                        time:   [20.671 µs 20.688 µs 20.704 µs]
Found 5 outliers among 200 measurements (2.50%)
  5 (2.50%) high mild
Comparisons Fib256/bench_wasmtime
                        time:   [3.4517 µs 3.4546 µs 3.4576 µs]
Found 28 outliers among 200 measurements (14.00%)
  7 (3.50%) low severe
  3 (1.50%) low mild
  10 (5.00%) high mild
  8 (4.00%) high severe
Comparisons Fib256/bench_wasmi
                        time:   [6.3279 µs 6.3302 µs 6.3326 µs]
Found 11 outliers among 200 measurements (5.50%)
  7 (3.50%) low mild
  3 (1.50%) high mild
  1 (0.50%) high severe
Comparisons Fib256/bench_rwasm
                        time:   [4.3529 µs 4.3721 µs 4.3918 µs]
Found 33 outliers among 200 measurements (16.50%)
  4 (2.00%) low severe
  3 (1.50%) low mild
  8 (4.00%) high mild
  18 (9.00%) high severe

Comparisons fib32/bench_native
                        time:   [6.8779 ns 6.8792 ns 6.8804 ns]
Found 19 outliers among 200 measurements (9.50%)
  9 (4.50%) low severe
  4 (2.00%) low mild
  2 (1.00%) high mild
  4 (2.00%) high severe
Comparisons fib32/bench_evm
                        time:   [22.919 µs 22.936 µs 22.955 µs]
Found 6 outliers among 200 measurements (3.00%)
  6 (3.00%) high mild
Comparisons fib32/bench_wasmtime
                        time:   [348.74 ns 348.87 ns 349.00 ns]
Found 8 outliers among 200 measurements (4.00%)
  7 (3.50%) low mild
  1 (0.50%) high severe
Comparisons fib32/bench_wasmi
                        time:   [418.12 ns 418.43 ns 418.75 ns]
Found 10 outliers among 200 measurements (5.00%)
  2 (1.00%) low mild
  8 (4.00%) high mild
Comparisons fib32/bench_rwasm
                        time:   [1.3066 µs 1.3071 µs 1.3076 µs]
Found 12 outliers among 200 measurements (6.00%)
  4 (2.00%) low mild
  4 (2.00%) high mild
  4 (2.00%) high severe

Comparisons fib64/bench_native
                        time:   [6.9353 ns 6.9380 ns 6.9408 ns]
Found 17 outliers among 200 measurements (8.50%)
  7 (3.50%) low mild
  6 (3.00%) high mild
  4 (2.00%) high severe
Comparisons fib64/bench_evm
                        time:   [24.887 µs 24.995 µs 25.093 µs]
Found 11 outliers among 200 measurements (5.50%)
  11 (5.50%) high mild
Comparisons fib64/bench_wasmtime
                        time:   [3.2854 µs 3.2883 µs 3.2913 µs]
Found 24 outliers among 200 measurements (12.00%)
  7 (3.50%) low severe
  5 (2.50%) low mild
  5 (2.50%) high mild
  7 (3.50%) high severe
Comparisons fib64/bench_wasmi
                        time:   [2.0707 µs 2.0715 µs 2.0725 µs]
Found 20 outliers among 200 measurements (10.00%)
  3 (1.50%) low severe
  4 (2.00%) low mild
  7 (3.50%) high mild
  6 (3.00%) high severe
Comparisons fib64/bench_rwasm
                        time:   [4.5058 µs 4.5076 µs 4.5096 µs]
Found 13 outliers among 200 measurements (6.50%)
  3 (1.50%) low mild
  5 (2.50%) high mild
  5 (2.50%) high severe

Comparisons Module Parsing/bench_evm
                        time:   [311.91 ps 312.60 ps 313.41 ps]
Found 25 outliers among 200 measurements (12.50%)
  5 (2.50%) high mild
  20 (10.00%) high severe
Comparisons Module Parsing/bench_wasmtime
                        time:   [37.247 µs 37.298 µs 37.349 µs]
Found 11 outliers among 200 measurements (5.50%)
  4 (2.00%) high mild
  7 (3.50%) high severe
Comparisons Module Parsing/bench_wasmi
                        time:   [19.648 µs 19.657 µs 19.666 µs]
Found 7 outliers among 200 measurements (3.50%)
  3 (1.50%) high mild
  4 (2.00%) high severe
Comparisons Module Parsing/bench_rwasm
                        time:   [10.238 µs 10.242 µs 10.246 µs]
Found 15 outliers among 200 measurements (7.50%)
  1 (0.50%) low severe
  2 (1.00%) low mild
  8 (4.00%) high mild

Heads-up: runner perf is noisy; treat deltas as a smoke check.

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 20.68966% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/wasmtime/mod.rs 22.22% 21 Missing ⚠️
src/vm/engine.rs 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@bfdays bfdays changed the base branch from devel to feat/optimisations October 10, 2025 10:13
Base automatically changed from feat/optimisations to devel October 14, 2025 19:10
@dmitry123 dmitry123 force-pushed the devel branch 2 times, most recently from bcc771d to d808ed0 Compare November 3, 2025 18:49
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