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

Optimize build_jumpdest_map() #308

Merged
merged 1 commit into from
Apr 27, 2021
Merged

Conversation

chfast
Copy link
Member

@chfast chfast commented Apr 27, 2021

Optimize the build_jumpdest_map() procedure by comparing opcode as
signed integer and eliminating always true op <= OP_PUSH32 (0x7f) check.

@chfast
Copy link
Member Author

chfast commented Apr 27, 2021

Benchmarks on Haswell 4.0 GHz, Clang 12.

Comparing o/master to o/opt
Benchmark                                                                Time             CPU      Time Old      Time New       CPU Old       CPU New
-----------------------------------------------------------------------------------------------------------------------------------------------------
baseline/analyse/main/blake2b_huff_mean                               -0.1258         -0.1258             6             5             6             5
baseline/analyse/main/blake2b_shifts_mean                             -0.0770         -0.0770             4             3             4             3
baseline/analyse/main/sha1_divs_mean                                  -0.0848         -0.0848             1             1             1             1
baseline/analyse/main/sha1_shifts_mean                                -0.0725         -0.0725             1             1             1             1
baseline/analyse/main/weierstrudel_mean                               -0.0948         -0.0948             8             7             8             7
baseline/analyse/micro/beginsub_push1s_0xffff_mean                    -0.0397         -0.0397            65            62            65            62
baseline/analyse/micro/beginsubs_0xffff_mean                          -0.2491         -0.2491            33            25            33            25
baseline/analyse/micro/jumpdests_0xffff_mean                          -0.0201         -0.0201            89            87            89            87
baseline/analyse/micro/loop_with_many_jumpdests_mean                  -0.0194         -0.0194            33            33            33            33
baseline/analyse/micro/push1s_0xffff_mean                             -0.0351         -0.0351            68            66            68            66
baseline/analyse/micro/push32s_0xffff_mean                            -0.0375         -0.0375             4             4             4             4
baseline/analyse/micro/zeros_0xffff_mean                              -0.2483         -0.2483            33            25            33            25

@chfast chfast force-pushed the analysis_jumpdest_optimization branch from 09711e0 to e47e240 Compare April 27, 2021 14:04
@chfast chfast requested review from axic, gumb0 and holiman April 27, 2021 14:05
@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #308 (96ddad5) into master (48964fc) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
- Coverage   99.76%   99.76%   -0.01%     
==========================================
  Files          24       24              
  Lines        3832     3831       -1     
==========================================
- Hits         3823     3822       -1     
  Misses          9        9              
Flag Coverage Δ
consensus 99.17% <100.00%> (-0.01%) ⬇️
unittests 99.76% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/evmone/baseline.cpp 99.82% <100.00%> (-0.01%) ⬇️

lib/evmone/baseline.cpp Outdated Show resolved Hide resolved
lib/evmone/baseline.cpp Outdated Show resolved Hide resolved
Optimize the build_jumpdest_map() procedure by comparing opcode as
signed integer and eliminating always true op <= OP_PUSH32 (0x7f) check.
@chfast chfast force-pushed the analysis_jumpdest_optimization branch from e47e240 to 96ddad5 Compare April 27, 2021 17:24
@chfast chfast merged commit 3361221 into master Apr 27, 2021
@chfast chfast deleted the analysis_jumpdest_optimization branch April 27, 2021 17:45
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.

2 participants