log, tridb/pathdb: fix bencharks

This commit is contained in:
Martin Holst Swende 2024-10-24 09:33:51 +02:00
parent 25bc07749c
commit d6bcad1c3e
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 4 additions and 6 deletions

View file

@ -7,7 +7,6 @@ import (
"io"
"log/slog"
"math/big"
"os"
"strings"
"testing"
"time"
@ -70,7 +69,7 @@ func TestJSONHandler(t *testing.T) {
}
func BenchmarkTraceLogging(b *testing.B) {
SetDefault(NewLogger(NewTerminalHandler(os.Stderr, true)))
SetDefault(NewLogger(NewTerminalHandler(io.Discard, true)))
b.ResetTimer()
for i := 0; i < b.N; i++ {
Trace("a message", "v", i)

View file

@ -76,7 +76,7 @@ func benchmarkSearch(b *testing.B, depth int, total int) {
nblob = common.CopyBytes(blob)
}
}
return newDiffLayer(parent, common.Hash{}, 0, 0, newNodeSet(nodes), nil)
return newDiffLayer(parent, common.Hash{}, 0, 0, newNodeSet(nodes), new(StateSetWithOrigin))
}
var layer layer
layer = emptyLayer()
@ -118,7 +118,7 @@ func BenchmarkPersist(b *testing.B) {
)
nodes[common.Hash{}][string(path)] = node
}
return newDiffLayer(parent, common.Hash{}, 0, 0, newNodeSet(nodes), nil)
return newDiffLayer(parent, common.Hash{}, 0, 0, newNodeSet(nodes), new(StateSetWithOrigin))
}
for i := 0; i < b.N; i++ {
b.StopTimer()
@ -156,8 +156,7 @@ func BenchmarkJournal(b *testing.B) {
)
nodes[common.Hash{}][string(path)] = node
}
// TODO(rjl493456442) a non-nil state set is expected.
return newDiffLayer(parent, common.Hash{}, 0, 0, newNodeSet(nodes), nil)
return newDiffLayer(parent, common.Hash{}, 0, 0, newNodeSet(nodes), new(StateSetWithOrigin))
}
var layer layer
layer = emptyLayer()