mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "trie: fix benchmark by ensuring key immutability (#28221)"
This reverts commit ce2182937b.
This commit is contained in:
parent
36a6192d46
commit
0a1873ca1b
1 changed files with 2 additions and 6 deletions
|
|
@ -614,9 +614,7 @@ func benchGet(b *testing.B) {
|
||||||
k := make([]byte, 32)
|
k := make([]byte, 32)
|
||||||
for i := 0; i < benchElemCount; i++ {
|
for i := 0; i < benchElemCount; i++ {
|
||||||
binary.LittleEndian.PutUint64(k, uint64(i))
|
binary.LittleEndian.PutUint64(k, uint64(i))
|
||||||
v := make([]byte, 32)
|
trie.MustUpdate(k, k)
|
||||||
binary.LittleEndian.PutUint64(v, uint64(i))
|
|
||||||
trie.MustUpdate(k, v)
|
|
||||||
}
|
}
|
||||||
binary.LittleEndian.PutUint64(k, benchElemCount/2)
|
binary.LittleEndian.PutUint64(k, benchElemCount/2)
|
||||||
|
|
||||||
|
|
@ -632,10 +630,8 @@ func benchUpdate(b *testing.B, e binary.ByteOrder) *Trie {
|
||||||
k := make([]byte, 32)
|
k := make([]byte, 32)
|
||||||
b.ReportAllocs()
|
b.ReportAllocs()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
v := make([]byte, 32)
|
|
||||||
e.PutUint64(k, uint64(i))
|
e.PutUint64(k, uint64(i))
|
||||||
e.PutUint64(v, uint64(i))
|
trie.MustUpdate(k, k)
|
||||||
trie.MustUpdate(k, v)
|
|
||||||
}
|
}
|
||||||
return trie
|
return trie
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue