(b *testing.B)
| 70 | } |
| 71 | |
| 72 | func BenchmarkCompiledIs(b *testing.B) { |
| 73 | oracle := pb.Oracle{Name: "simple", Code: "function simple(){ return 0; }"} |
| 74 | compiled, err := compile(&oracle) |
| 75 | if err != nil { |
| 76 | b.Fatal(err) |
| 77 | } |
| 78 | |
| 79 | b.ResetTimer() |
| 80 | for i := 0; i < b.N; i++ { |
| 81 | if !compiled.Is(oracle) { |
| 82 | b.Fatal("compiled object does not match source oracle") |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | func benchVM(b *testing.B, fname, code string, args []string, expected string, records *storage.Records) { |
| 88 | oracle := pb.Oracle{ |