-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Change the return type of step_inner function. #10940
Conversation
It looks like @Leeleo3x hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
[clabot:check] |
It looks like @Leeleo3x signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Do you mind including the benchmark code in the PR? Removing the error conversion and all uses of |
The benchmark I'm using is included in current Parity code base. To run benchmarks:
I do understand |
I think the benches are from
That's a known issue rust-lang/rust#37939 |
I had no idea, thank you for educating me. |
* master: journaldb changes (#10929) Allow default block parameter to be blockHash (#10932) Enable sealing when engine is ready (#10938) Fix some warnings and typos. (#10941) Updated [email protected] key (#10939) Change the return type of step_inner function. (#10940) get rid of hidden mutability of Spec (#10904) simplify BlockReward::reward implementation (#10906) Kaspersky AV whitelisting (#10919) additional arithmetic EVM opcode benchmarks (#10916) [Cargo.lock] cargo update -p crossbeam-epoch (#10921) Fixes incorrect comment. (#10913) Add file path to disk map write/read warnings (#10911)
* Change the return type of step_inner function. * Fix indention.
* master: [evmbin] fix compilation (#10976) Update to latest trie version. (#10972) [blooms-db] Fix benchmarks (#10974) Fix ethcore/benches build. (#10964) tx-pool: accept local tx with higher gas price when pool full (#10901) Disable unsyncable expanse chain (#10926) Extract Machine from ethcore (#10949) removed redundant state_root function from spec, improve spec error types (#10955) Add support for Energy Web Foundation's new chains (#10957) [evmbin] add more tests to main.rs (#10956) Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953) unify loading spec && further spec cleanups (#10948) refactor: Refactor evmbin CLI (#10742) journaldb changes (#10929) Allow default block parameter to be blockHash (#10932) Enable sealing when engine is ready (#10938) Fix some warnings and typos. (#10941) Updated [email protected] key (#10939) Change the return type of step_inner function. (#10940)
* Change the return type of step_inner function. * Fix indention.
This PR simplifies the return result of step_inner function.
Using
Result<Never, InterpreterResult>
as return result will causeunnecessary overhead (mostly additional memory operations). Since
step_inner is a hot function, I propose to simplify the return type of
step_inner function and handle the error results manually.
Some benchmark results I have:
Without Optimization (Original Version):
test rng_u256 ... bench: 68,395,922 ns/iter (+/- 19,520,348)
test rng_usize ... bench: 46,822,703 ns/iter (+/- 19,869,026)
test simple_loop_u256 ... bench: 18,807,019 ns/iter (+/- 5,683,907)
test simple_loop_usize ... bench: 13,812,568 ns/iter (+/- 3,310,862)
With Optimization:
test rng_u256 ... bench: 53,654,255 ns/iter (+/- 12,985,727)
test rng_usize ... bench: 36,481,886 ns/iter (+/- 13,044,046)
test simple_loop_u256 ... bench: 15,010,101 ns/iter (+/- 5,306,132)
test simple_loop_usize ... bench: 10,584,103 ns/iter (+/- 2,439,375)
Some perf results I have: