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

perf(vm): space efficient opcode implementations #481

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Conversation

Jon-Becker
Copy link
Owner

Motivation

Solution

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [clippy] reported by reviewdog 🐶

warning: use of a fallible conversion when an infallible one could be used
   --> crates/vm/src/core/vm.rs:751:33
    |
751 |                 self.stack.push(U256::try_from(result)?, operation);
    |                                 ^^^^^^^^^^^^^^ help: use: `From::from`
    |
    = note: converting `FixedBytes<32>` to `Uint<256, 4>` cannot fail
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
    = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default

self.stack.push(U256::try_from(result)?, operation);

Copy link
Contributor

Benchmark for 02cb045

Click to view benchmark
Test Base PR %
heimdall_cfg/complex 14.6±1.55ms 14.4±1.03ms -1.37%
heimdall_cfg/simple 2.1±0.14ms 2.1±0.02ms 0.00%
heimdall_decoder/seaport 33.3±3.12µs 33.6±3.41µs +0.90%
heimdall_decoder/transfer 3.6±0.28µs 3.7±0.39µs +2.78%
heimdall_decoder/uniswap 9.8±0.62µs 10.3±0.86µs +5.10%
heimdall_decompiler/abi_complex 54.8±1.69ms 58.9±3.85ms +7.48%
heimdall_decompiler/abi_simple 2.2±0.12ms 2.2±0.02ms 0.00%
heimdall_decompiler/sol_complex 73.8±4.83ms 69.9±2.31ms -5.28%
heimdall_decompiler/sol_simple 2.5±0.02ms 2.4±0.02ms -4.00%
heimdall_decompiler/yul_complex 68.8±2.56ms 58.7±3.65ms -14.68%
heimdall_decompiler/yul_simple 2.3±0.13ms 2.2±0.09ms -4.35%
heimdall_disassembler/complex 868.1±78.19µs 930.5±169.16µs +7.19%
heimdall_disassembler/simple 41.8±2.46µs 45.3±7.09µs +8.37%
heimdall_vm/erc20_transfer 370.5±49.16µs 341.4±55.35µs -7.85%
heimdall_vm/fib 775.2±83.36µs 790.9±57.95µs +2.03%
heimdall_vm/ten_thousand_hashes 605.1±28.93ms 567.2±33.38ms -6.26%

@Jon-Becker Jon-Becker merged commit 3da605a into main Aug 16, 2024
8 checks passed
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.

1 participant