feat: use memmap instead of paged_vecs on platforms that support it#1734
Conversation
This comment has been minimized.
This comment has been minimized.
CodSpeed WallTime Performance ReportMerging #1734 will improve performances by 44.58%Comparing
|
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | benchmark_execute[bubblesort] |
330.4 ms | 166.4 ms | +98.57% |
| ⚡ | benchmark_execute[factorial_iterative_u256] |
742.4 ms | 443.8 ms | +67.28% |
| ⚡ | benchmark_execute[fibonacci_iterative] |
351.6 ms | 174.3 ms | ×2 |
| ⚡ | benchmark_execute[fibonacci_recursive] |
447.6 ms | 223 ms | ×2 |
| ⚡ | benchmark_execute[keccak256] |
343.6 ms | 165.5 ms | ×2.1 |
| ⚡ | benchmark_execute[keccak256_iter] |
489.7 ms | 247.2 ms | +98.1% |
| ⚡ | benchmark_execute[quicksort] |
352.6 ms | 171.7 ms | ×2.1 |
| ⚡ | benchmark_execute[revm_snailtracer] |
279.6 ms | 139.5 ms | ×2 |
| ⚡ | benchmark_execute[sha256] |
335.7 ms | 166.5 ms | ×2 |
| ⚡ | benchmark_execute[sha256_iter] |
500.2 ms | 263.2 ms | +90.1% |
| ⚡ | benchmark_execute_metered[bubblesort] |
429.8 ms | 243.5 ms | +76.52% |
| ⚡ | benchmark_execute_metered[factorial_iterative_u256] |
1,098.4 ms | 759.7 ms | +44.58% |
| ⚡ | benchmark_execute_metered[fibonacci_iterative] |
489.2 ms | 301.5 ms | +62.24% |
| ⚡ | benchmark_execute_metered[fibonacci_recursive] |
601.5 ms | 369.8 ms | +62.66% |
| ⚡ | benchmark_execute_metered[keccak256] |
455 ms | 249.9 ms | +82.08% |
| ⚡ | benchmark_execute_metered[keccak256_iter] |
681.5 ms | 429.4 ms | +58.69% |
| ⚡ | benchmark_execute_metered[quicksort] |
458.4 ms | 262.6 ms | +74.58% |
| ⚡ | benchmark_execute_metered[revm_snailtracer] |
290.5 ms | 140.4 ms | ×2.1 |
| ⚡ | benchmark_execute_metered[sha256] |
445.5 ms | 249.2 ms | +78.76% |
| ⚡ | benchmark_execute_metered[sha256_iter] |
698.1 ms | 441.4 ms | +58.13% |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
CodSpeed Instrumentation Performance ReportMerging #1734 will improve performances by 11.69%Comparing Summary
Benchmarks breakdown
|
This comment has been minimized.
This comment has been minimized.
dde8c9e to
a5f3b04
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
59b5653 to
c4dbe6d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7ad7a35 to
fa49d91
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The micro-benchmarks have a much higher tracegen time because the memory image to clone for the initial merkle tree is now bigger. This is only a significant factor because the microbenchmarks have such small memory allocated. |
Introduce a `LinearMemory` trait to clarify the API of underlying memory implementations: - mmap based - remove `PagedVec` and implement a simple `Vec` backed `BasicMemory` The trait functions are chosen to mirror `core::ptr::*` functions. I updated the safety documentation and also made some small optimizations to use `core::ptr::read` and `core::ptr::swap` when appropriate. One side-effect is that `write` functions should now take the data by value and not reference once again.
jonathanpwang
left a comment
There was a problem hiding this comment.
LGTM
The sdk and cli tests are now very slow, maybe we can increase the test-threads a bit if the OOM is not a concern.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
For each address space, find where the last nonzero value is and only use that prefix in `memory_to_vec_partition`
This comment was marked as outdated.
This comment was marked as outdated.
Use the new `MerkleTree` struct instead. Note the construction of the initial memory image and also the user public values proof both reconstructs the Merkle Tree from scratch -- this is slow.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
The merkle memory finalization is slower in micro-benchmarks, and there are ways to address this (notably the merkle tree construction can be updated to directly use a segment tree now). However to avoid making this PR balloon even more and also to prevent merge conflicts, we will merge it first. |
Commit: bb09764 |
resolve INT-3754
reth benchmark comparison: https://github.com/axiom-crypto/openvm-reth-benchmark/actions/runs/15863851635