From cf0b39c0c8e0b6c248bf5539bbab5d732723171f Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Tue, 8 Apr 2025 14:57:23 +0200 Subject: [PATCH] core/vm: remove unnecessary benchmarks --- core/vm/instructions_test.go | 51 ------------------------------------ 1 file changed, 51 deletions(-) diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index 9829e4a633..0902d17c54 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -972,54 +972,3 @@ func TestPush(t *testing.T) { } } } - -func FuzzPush(f *testing.F) { - push2 := makePush(2, 2) - f.Fuzz(func(t *testing.T, code []byte, origPC uint64) { - scope := &ScopeContext{ - Memory: nil, - Stack: newstack(), - Contract: &Contract{ - Code: code, - }, - } - pc := origPC - push2(&pc, nil, scope) - a := scope.Stack.pop() - pc = origPC - opPush2(&pc, nil, scope) - b := scope.Stack.pop() - if a.Cmp(&b) != 0 { - panic(fmt.Sprintf("code: %v origPC: %v, %v %v", code, origPC, a, b)) - } - }) -} - -func BenchmarkPush(b *testing.B) { - var ( - code = common.FromHex("0011223344556677889900aabbccddeeff0102030405060708090a0b0c0d0e0ff1e1d1c1b1a19181716151413121") - push2 = makePush(2, 2) - scope = &ScopeContext{ - Memory: nil, - Stack: newstack(), - Contract: &Contract{ - Code: code, - }, - } - pc = new(uint64) - ) - - b.Run("makePush", func(b *testing.B) { - for i := 0; i < b.N; i++ { - push2(pc, nil, scope) - scope.Stack.pop() - } - }) - - b.Run("push", func(b *testing.B) { - for i := 0; i < b.N; i++ { - opPush2(pc, nil, scope) - scope.Stack.pop() - } - }) -}