Skip to content

Commit

Permalink
Revert "trie: fix benchmark by ensuring key immutability (ethereum#28221
Browse files Browse the repository at this point in the history
)"

This reverts commit ce21829.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent e29b08a commit 4e3f16b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions trie/trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,7 @@ func benchGet(b *testing.B) {
k := make([]byte, 32)
for i := 0; i < benchElemCount; i++ {
binary.LittleEndian.PutUint64(k, uint64(i))
v := make([]byte, 32)
binary.LittleEndian.PutUint64(v, uint64(i))
trie.MustUpdate(k, v)
trie.MustUpdate(k, k)
}
binary.LittleEndian.PutUint64(k, benchElemCount/2)

Expand All @@ -632,10 +630,8 @@ func benchUpdate(b *testing.B, e binary.ByteOrder) *Trie {
k := make([]byte, 32)
b.ReportAllocs()
for i := 0; i < b.N; i++ {
v := make([]byte, 32)
e.PutUint64(k, uint64(i))
e.PutUint64(v, uint64(i))
trie.MustUpdate(k, v)
trie.MustUpdate(k, k)
}
return trie
}
Expand Down

0 comments on commit 4e3f16b

Please sign in to comment.