go-ethereum/trie
Martin Holst Swende 5bf8769fb0
ethdb/memorydb, trie: reduced allocations (#28473)
* trie: use pooling of iterator states in iterator

The node iterator burns through a lot of memory while iterating a trie, and a lot of
that can be avoided by using a fairly small pool (max 40 items).

name        old time/op    new time/op    delta
Iterator-8    6.22ms ± 3%    5.40ms ± 6%  -13.18%  (p=0.008 n=5+5)

name        old alloc/op   new alloc/op   delta
Iterator-8    2.36MB ± 0%    1.67MB ± 0%  -29.23%  (p=0.008 n=5+5)

name        old allocs/op  new allocs/op  delta
Iterator-8     37.0k ± 0%     29.8k ± 0%     ~     (p=0.079 n=4+5)

* ethdb/memorydb: avoid one copying of key

By making the transformation from []byte to string at an earlier point,
we save an allocation which otherwise happens later on.

name           old time/op    new time/op    delta
BatchAllocs-8     412µs ± 6%     382µs ± 2%   -7.18%  (p=0.016 n=5+4)

name           old alloc/op   new alloc/op   delta
BatchAllocs-8     480kB ± 0%     490kB ± 0%   +1.93%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
BatchAllocs-8     3.03k ± 0%     2.03k ± 0%  -32.98%  (p=0.008 n=5+5)
2023-11-15 16:20:34 +01:00
..
testutil all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
triedb trie/triedb/pathdb: improve dirty node flushing trigger (#28426) 2023-10-31 11:39:55 +02:00
trienode cmd, core, trie: verkle-capable `geth init` (#28270) 2023-11-14 13:09:40 +01:00
triestate all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
utils cmd, core, trie: verkle-capable `geth init` (#28270) 2023-11-14 13:09:40 +01:00
committer.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
database.go cmd, core, trie: verkle-capable `geth init` (#28270) 2023-11-14 13:09:40 +01:00
database_test.go core, trie: cleanup trie database (#28062) 2023-09-07 21:17:14 +08:00
encoding.go trie: reduce allocs in recHash (#27770) 2023-08-18 22:41:19 +02:00
encoding_test.go trie: reduce allocs in recHash (#27770) 2023-08-18 22:41:19 +02:00
errors.go cmd, core/state, eth, tests, trie: improve state reader (#27428) 2023-06-20 15:31:45 -04:00
hasher.go trie: spelling - fix comments in hasher (#28507) 2023-11-14 14:27:07 +01:00
iterator.go ethdb/memorydb, trie: reduced allocations (#28473) 2023-11-15 16:20:34 +01:00
iterator_test.go ethdb/memorydb, trie: reduced allocations (#28473) 2023-11-15 16:20:34 +01:00
node.go core, trie: rework trie database (#26813) 2023-04-24 10:38:52 +03:00
node_enc.go core, trie: rework trie database (#26813) 2023-04-24 10:38:52 +03:00
node_test.go trie: improve node rlp decoding performance (#25357) 2022-08-19 00:39:47 +02:00
preimages.go core, trie, eth, cmd: rework preimage store (#25287) 2022-07-27 20:37:04 +02:00
proof.go trie: make rhs-proof align with last key in range proofs (#28311) 2023-10-13 16:05:29 +02:00
proof_test.go trie: make rhs-proof align with last key in range proofs (#28311) 2023-10-13 16:05:29 +02:00
secure_trie.go trie, core/state: revert error removal in (*state.Trie).Commit (#27544) 2023-06-27 15:36:38 +03:00
secure_trie_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
stacktrie.go trie: use explicit errors in stacktrie (instead of panic) (#28361) 2023-10-25 14:53:50 +02:00
stacktrie_fuzzer_test.go tests/fuzzers: move fuzzers into native packages (#28467) 2023-11-14 14:34:29 +01:00
stacktrie_test.go trie: use explicit errors in stacktrie (instead of panic) (#28361) 2023-10-25 14:53:50 +02:00
sync.go core, eth, trie: filter out boundary nodes and remove dangling nodes in stacktrie (#28327) 2023-10-23 18:31:56 +03:00
sync_test.go ethdb/memorydb, trie: reduced allocations (#28473) 2023-11-15 16:20:34 +01:00
tracer.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
tracer_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
trie.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
trie_id.go cmd, core, eth, les, light: track deleted nodes (#25757) 2022-09-27 10:01:02 +02:00
trie_reader.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
trie_test.go tests/fuzzers: move fuzzers into native packages (#28467) 2023-11-14 14:34:29 +01:00
verkle.go cmd, core, trie: verkle-capable `geth init` (#28270) 2023-11-14 13:09:40 +01:00
verkle_test.go cmd, core, trie: verkle-capable `geth init` (#28270) 2023-11-14 13:09:40 +01:00