go-ethereum/ethdb
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
..
dbtest all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
leveldb ethdb, internal/ethapi: support exposing Pebble stats too, beside LevelDB (#28224) 2023-09-28 22:27:21 +03:00
memorydb ethdb/memorydb, trie: reduced allocations (#28473) 2023-11-15 16:20:34 +01:00
pebble ethdb/pebble: add Errorf function to panicLogger (#28491) 2023-11-09 15:15:22 +01:00
remotedb all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
batch.go core, ethdb, tests, trie: implement NewBatchWithSize API for batcher (#24392) 2022-02-15 15:15:13 +02:00
database.go all: implement path-based state scheme (#25963) 2023-08-01 15:17:32 +03:00
iterator.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
snapshot.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00