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

feat: Use binary search in GetPrecompileModuleByAddress #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

drklee3
Copy link
Member

@drklee3 drklee3 commented May 1, 2024

Benchmarks w/ 1000 registered modules (benchmarks included in pr):

goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/precompile/modules
                                │   old.txt    │              new.txt               │
                                │    sec/op    │   sec/op     vs base               │
GetPrecompileModuleByAddress-12   1460.5n ± 1%   319.1n ± 1%  -78.15% (p=0.002 n=6)

                                │  old.txt   │            new.txt            │
                                │    B/op    │    B/op     vs base           │
GetPrecompileModuleByAddress-12   7.000 ± 0%   7.000 ± 0%  ~ (p=1.000 n=6) ¹
¹ all samples are equal

                                │  old.txt   │            new.txt            │
                                │ allocs/op  │ allocs/op   vs base           │
GetPrecompileModuleByAddress-12   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=6) ¹
¹ all samples are equal

resolves #29

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.

Refactor stateful precompile look ups to use binary search
1 participant