aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/analysis_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/analysis_test.go')
-rw-r--r--core/vm/analysis_test.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/core/vm/analysis_test.go b/core/vm/analysis_test.go
index a64f90ed9..fd2d744d8 100644
--- a/core/vm/analysis_test.go
+++ b/core/vm/analysis_test.go
@@ -16,7 +16,11 @@
package vm
-import "testing"
+import (
+ "testing"
+
+ "github.com/ethereum/go-ethereum/crypto"
+)
func TestJumpDestAnalysis(t *testing.T) {
tests := []struct {
@@ -49,5 +53,23 @@ func TestJumpDestAnalysis(t *testing.T) {
t.Fatalf("expected %x, got %02x", test.exp, ret[test.which])
}
}
+}
+func BenchmarkJumpdestAnalysis_1200k(bench *testing.B) {
+ // 1.4 ms
+ code := make([]byte, 1200000)
+ bench.ResetTimer()
+ for i := 0; i < bench.N; i++ {
+ codeBitmap(code)
+ }
+ bench.StopTimer()
+}
+func BenchmarkJumpdestHashing_1200k(bench *testing.B) {
+ // 4 ms
+ code := make([]byte, 1200000)
+ bench.ResetTimer()
+ for i := 0; i < bench.N; i++ {
+ crypto.Keccak256Hash(code)
+ }
+ bench.StopTimer()
}