etclabscore / multi-geth-fork

GNU Lesser General Public License v3.0
3 stars 8 forks source link

core/[state|vm],trie: inspect and test getbalance costs for DNE addrs #152

Closed meowsbits closed 4 years ago

meowsbits commented 4 years ago

Benchmarks for DNE (Do Not Exist) address BALANCE calls.

> go test -bench Benchmark.*GetBalance ./core/state/...
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/state
BenchmarkStateDB_GetBalance_Existing-12          2528650
490 ns/op
BenchmarkStateDB_GetBalance_DNE-12                252471
4267 ns/op
PASS
ok      github.com/ethereum/go-ethereum/core/state      10.503s

> go test -bench Benchmark.*BalanceDNE ./core/vm/...
PASS
ok      github.com/ethereum/go-ethereum/core/vm 0.155s
goos: linux
goarch: amd64
pkg: github.com/ethereum/go-ethereum/core/vm/runtime
BenchmarkEVM_BalanceDNE_Gas40-12                   42105
28429 ns/op
BenchmarkEVM_BalanceDNE_Gas400-12                  43124
28241 ns/op
BenchmarkEVM_BalanceDNE_Gas4000-12                 30919
39121 ns/op
BenchmarkEVM_BalanceDNE_Gas40000-12                 9037
155781 ns/op
BenchmarkEVM_BalanceDNE_Gas004Gwei-12                 10
127698023 ns/op
BenchmarkEVM_BalanceDNE_Gas04Gwei-12                   1
1098864244 ns/op
BenchmarkEVM_BalanceDNE_Gas4Gwei-12                    1
11883739376 ns/op
BenchmarkEVM_BalanceDNE_Gas40Gwei-12                   1
119108679718 ns/op
PASS
ok      github.com/ethereum/go-ethereum/core/vm/runtime 139.523s

Signed-off-by: meows b5c6@protonmail.com

meowsbits commented 4 years ago

Moved -> https://github.com/etclabscore/core-geth/pull/28