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

core/vm: rework jumpdest analysis benchmarks #23499

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

chfast
Copy link
Contributor

@chfast chfast commented Aug 30, 2021

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB and classic benchmark loop.

> go test -bench Jumpdest ./core/vm
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm
cpu: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
BenchmarkJumpdestAnalysis_1200k-8           2296            520734 ns/op        2359.75 MB/s
BenchmarkJumpdestHashing_1200k-8             374           3144320 ns/op         390.80 MB/s
BenchmarkJumpdestOpAnalysis/PUSH1-8         1222            979226 ns/op        1254.87 MB/s
BenchmarkJumpdestOpAnalysis/PUSH2-8         1269            949313 ns/op        1294.41 MB/s
BenchmarkJumpdestOpAnalysis/PUSH3-8         1747            693702 ns/op        1771.37 MB/s
BenchmarkJumpdestOpAnalysis/PUSH4-8         2064            580610 ns/op        2116.40 MB/s
BenchmarkJumpdestOpAnalysis/PUSH5-8         2450            490246 ns/op        2506.50 MB/s
BenchmarkJumpdestOpAnalysis/PUSH6-8         2578            464158 ns/op        2647.38 MB/s
BenchmarkJumpdestOpAnalysis/PUSH7-8         3426            349600 ns/op        3514.88 MB/s
BenchmarkJumpdestOpAnalysis/PUSH8-8         2959            405411 ns/op        3031.00 MB/s
BenchmarkJumpdestOpAnalysis/PUSH9-8         3300            363186 ns/op        3383.39 MB/s
BenchmarkJumpdestOpAnalysis/PUSH10-8                2762            433539 ns/op        2834.35 MB/s
BenchmarkJumpdestOpAnalysis/PUSH11-8                2854            419256 ns/op        2930.91 MB/s
BenchmarkJumpdestOpAnalysis/PUSH12-8                3392            352346 ns/op        3487.48 MB/s
BenchmarkJumpdestOpAnalysis/PUSH13-8                3620            330475 ns/op        3718.28 MB/s
BenchmarkJumpdestOpAnalysis/PUSH14-8                3506            337805 ns/op        3637.61 MB/s
BenchmarkJumpdestOpAnalysis/PUSH15-8                3594            332182 ns/op        3699.17 MB/s
BenchmarkJumpdestOpAnalysis/PUSH16-8                4899            240817 ns/op        5102.62 MB/s
BenchmarkJumpdestOpAnalysis/PUSH17-8                5511            210879 ns/op        5827.03 MB/s
BenchmarkJumpdestOpAnalysis/PUSH18-8                4498            265887 ns/op        4621.51 MB/s
BenchmarkJumpdestOpAnalysis/PUSH19-8                4502            265590 ns/op        4626.68 MB/s
BenchmarkJumpdestOpAnalysis/PUSH20-8                5181            231383 ns/op        5310.68 MB/s
BenchmarkJumpdestOpAnalysis/PUSH21-8                5390            223635 ns/op        5494.66 MB/s
BenchmarkJumpdestOpAnalysis/PUSH22-8                5059            232717 ns/op        5280.23 MB/s
BenchmarkJumpdestOpAnalysis/PUSH23-8                5137            233021 ns/op        5273.34 MB/s
BenchmarkJumpdestOpAnalysis/PUSH24-8                5631            212401 ns/op        5785.28 MB/s
BenchmarkJumpdestOpAnalysis/PUSH25-8                5566            215068 ns/op        5713.55 MB/s
BenchmarkJumpdestOpAnalysis/PUSH26-8                5005            239064 ns/op        5140.05 MB/s
BenchmarkJumpdestOpAnalysis/PUSH27-8                4989            239589 ns/op        5128.79 MB/s
BenchmarkJumpdestOpAnalysis/PUSH28-8                5527            215729 ns/op        5696.05 MB/s
BenchmarkJumpdestOpAnalysis/PUSH29-8                5695            209925 ns/op        5853.53 MB/s
BenchmarkJumpdestOpAnalysis/PUSH30-8                5012            217636 ns/op        5646.12 MB/s
BenchmarkJumpdestOpAnalysis/PUSH31-8                5478            218488 ns/op        5624.12 MB/s
BenchmarkJumpdestOpAnalysis/PUSH32-8                7039            169517 ns/op        7248.82 MB/s
BenchmarkJumpdestOpAnalysis/JUMPDEST-8              2448            489197 ns/op        2511.87 MB/s
BenchmarkJumpdestOpAnalysis/STOP-8                  2448            489231 ns/op        2511.70 MB/s
PASS
ok      github.com/ethereum/go-ethereum/core/vm 46.594s

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@chfast
Copy link
Contributor Author

chfast commented Aug 30, 2021

Comparison without and with bitvec clearing in the benchmark loop:

name                           old time/op    new time/op    delta                                                                                                                                                                
JumpdestOpAnalysis/PUSH1-8        979µs ± 0%     983µs ± 0%  +0.42%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH2-8        943µs ± 0%     947µs ± 0%  +0.40%  (p=0.000 n=8+8)                                                                                                                                              
JumpdestOpAnalysis/PUSH3-8        694µs ± 0%     698µs ± 0%  +0.55%  (p=0.000 n=10+10)                                                                                                                                            
JumpdestOpAnalysis/PUSH4-8        581µs ± 0%     584µs ± 0%  +0.62%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH5-8        489µs ± 0%     493µs ± 0%  +0.76%  (p=0.000 n=8+8)                                                                                                                                              
JumpdestOpAnalysis/PUSH6-8        464µs ± 0%     468µs ± 0%  +0.80%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH7-8        350µs ± 0%     353µs ± 0%  +1.04%  (p=0.000 n=9+8)                                                                                                                                              
JumpdestOpAnalysis/PUSH8-8        405µs ± 0%     409µs ± 0%  +0.88%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH9-8        362µs ± 0%     366µs ± 0%  +1.11%  (p=0.000 n=8+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH10-8       434µs ± 0%     438µs ± 0%  +0.93%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH11-8       419µs ± 0%     423µs ± 0%  +0.90%  (p=0.000 n=9+8)                                                                                                                                              
JumpdestOpAnalysis/PUSH12-8       352µs ± 0%     356µs ± 0%  +1.05%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH13-8       330µs ± 0%     341µs ± 5%  +3.58%  (p=0.000 n=9+9)                                                                                                                                              
JumpdestOpAnalysis/PUSH14-8       338µs ± 0%     342µs ± 0%  +1.10%  (p=0.000 n=9+9)
JumpdestOpAnalysis/PUSH15-8       332µs ± 1%     336µs ± 0%  +1.03%  (p=0.000 n=9+10)
JumpdestOpAnalysis/PUSH16-8       241µs ± 4%     247µs ± 2%  +2.80%  (p=0.009 n=10+10)
JumpdestOpAnalysis/PUSH17-8       211µs ± 0%     221µs ± 0%  +4.93%  (p=0.000 n=8+9)
JumpdestOpAnalysis/PUSH18-8       266µs ± 0%     270µs ± 0%  +1.36%  (p=0.000 n=9+8)
JumpdestOpAnalysis/PUSH19-8       266µs ± 0%     269µs ± 0%  +1.41%  (p=0.000 n=8+9)
JumpdestOpAnalysis/PUSH20-8       231µs ± 0%     235µs ± 0%  +1.59%  (p=0.000 n=9+9)
JumpdestOpAnalysis/PUSH21-8       222µs ± 0%     226µs ± 0%  +1.67%  (p=0.000 n=8+8)
JumpdestOpAnalysis/PUSH22-8       233µs ± 0%     237µs ± 0%  +1.65%  (p=0.000 n=10+10)
JumpdestOpAnalysis/PUSH23-8       233µs ± 0%     237µs ± 0%  +1.58%  (p=0.000 n=9+9)
JumpdestOpAnalysis/PUSH24-8       213µs ± 0%     216µs ± 0%  +1.70%  (p=0.000 n=9+9)
JumpdestOpAnalysis/PUSH25-8       215µs ± 0%     219µs ± 0%  +1.73%  (p=0.000 n=9+8)
JumpdestOpAnalysis/PUSH26-8       239µs ± 0%     243µs ± 0%  +1.55%  (p=0.000 n=9+8)
JumpdestOpAnalysis/PUSH27-8       240µs ± 0%     243µs ± 0%  +1.54%  (p=0.000 n=9+8)
JumpdestOpAnalysis/PUSH28-8       216µs ± 0%     220µs ± 0%  +1.66%  (p=0.000 n=7+10)
JumpdestOpAnalysis/PUSH29-8       210µs ± 0%     213µs ± 0%  +1.69%  (p=0.000 n=10+9)
JumpdestOpAnalysis/PUSH30-8       218µs ± 0%     221µs ± 0%  +1.70%  (p=0.000 n=10+10)
JumpdestOpAnalysis/PUSH31-8       218µs ± 0%     222µs ± 0%  +1.72%  (p=0.000 n=9+9)
JumpdestOpAnalysis/PUSH32-8       169µs ± 0%     173µs ± 0%  +2.16%  (p=0.000 n=9+8)
JumpdestOpAnalysis/JUMPDEST-8     490µs ± 0%     493µs ± 0%  +0.69%  (p=0.000 n=10+9)
JumpdestOpAnalysis/STOP-8         490µs ± 0%     493µs ± 0%  +0.61%  (p=0.000 n=10+8)

@holiman holiman added this to the 1.10.9 milestone Aug 30, 2021
@holiman holiman merged commit 3258211 into ethereum:master Aug 30, 2021
sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Aug 30, 2021
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Nov 12, 2021
* change cache type of GetCode from fastcache to lrucache

Signed-off-by: kyrie-yl <yl.on.the.way@gmail.com>

* add cache for contract code bitmap

Signed-off-by: kyrie-yl <yl.on.the.way@gmail.com>

* core/vm: rework jumpdest analysis benchmarks (ethereum#23499)

* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark

Co-authored-by: Paweł Bylica <chfast@gmail.com>
yongjun925 pushed a commit to DODOEX/go-ethereum that referenced this pull request Dec 3, 2022
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 22, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 23, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 26, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 27, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Feb 27, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Mar 1, 2024
* core/vm: rework jumpdest analysis benchmarks

For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.

* core/vm: clear bitvec in jumpdest analysis benchmark
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.

None yet

2 participants