diff options
author | Hyung-Kyu Hqueue Choi <hyungkyu.choi@gmail.com> | 2018-08-03 13:15:33 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-08-03 13:15:33 +0800 |
commit | 0ab54de1a5e4736b7eafb240d5abba09f43a3034 (patch) | |
tree | 8632ba27944631d1326c51ffb37d36494191b20f /core | |
parent | adc2944b4c9fc3dc6192e2fc5d1cc1200c6edf6b (diff) | |
download | go-tangerine-0ab54de1a5e4736b7eafb240d5abba09f43a3034.tar.gz go-tangerine-0ab54de1a5e4736b7eafb240d5abba09f43a3034.tar.zst go-tangerine-0ab54de1a5e4736b7eafb240d5abba09f43a3034.zip |
core/vm: update benchmarks for core/vm (#17308)
- Update benchmarks to use a pool of int pools.
Unless benchmarks are aborted with segmentation fault.
Signed-off-by: Hyung-Kyu Choi <hqueue@users.noreply.github.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/instructions_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index ec5de94ed..48caadf1f 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -214,6 +214,7 @@ func opBenchmark(bench *testing.B, op func(pc *uint64, interpreter *EVMInterpret ) env.interpreter = evmInterpreter + evmInterpreter.intPool = poolOfIntPools.get() // convert args byteArgs := make([][]byte, len(args)) for i, arg := range args { @@ -229,6 +230,7 @@ func opBenchmark(bench *testing.B, op func(pc *uint64, interpreter *EVMInterpret op(&pc, evmInterpreter, nil, nil, stack) stack.pop() } + poolOfIntPools.put(evmInterpreter.intPool) } func BenchmarkOpAdd64(b *testing.B) { @@ -474,6 +476,7 @@ func BenchmarkOpMstore(bench *testing.B) { ) env.interpreter = evmInterpreter + evmInterpreter.intPool = poolOfIntPools.get() mem.Resize(64) pc := uint64(0) memStart := big.NewInt(0) @@ -484,4 +487,5 @@ func BenchmarkOpMstore(bench *testing.B) { stack.pushN(value, memStart) opMstore(&pc, evmInterpreter, nil, mem, stack) } + poolOfIntPools.put(evmInterpreter.intPool) } |