neo-go/pkg/core/mpt
Roman Khimov d9ee31fb52 *: use clear() to clear maps
Supposedly more efficient since we can avoid some memory management dances.

Memory pool agrees:

goos: linux
goarch: amd64
pkg: github.com/nspcc-dev/neo-go/pkg/core/mempool
cpu: AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
                       │  pool.old   │              pool.new               │
                       │   sec/op    │   sec/op     vs base                │
Pool/one,_incr_fee-16    12.44m ± 1%   12.51m ± 1%   +0.55% (p=0.029 n=10)
Pool/many,_same_fee-16   4.960m ± 2%   3.100m ± 1%  -37.50% (p=0.000 n=10)
Pool/many,_incr_fee-16   16.03m ± 2%   14.11m ± 1%  -12.00% (p=0.000 n=10)
Pool/one,_same_fee-16                  1.742m ± 1%
geomean                  9.964m        5.556m       -17.92%

                       │    pool.old     │                pool.new                │
                       │      B/op       │      B/op       vs base                │
Pool/one,_incr_fee-16     8.117Ki ± 120%   7.101Ki ± 128%  -12.52% (p=0.022 n=10)
Pool/many,_same_fee-16   3941.2Ki ±   0%   805.4Ki ±   0%  -79.56% (p=0.000 n=10)
Pool/many,_incr_fee-16   3936.2Ki ±   0%   829.8Ki ±   0%  -78.92% (p=0.000 n=10)
Pool/one,_same_fee-16                      12.98Ki ±  10%
geomean                   501.2Ki          88.59Ki         -66.47%

                       │   pool.old   │               pool.new               │
                       │  allocs/op   │  allocs/op    vs base                │
Pool/one,_incr_fee-16     28.00 ± 21%    24.00 ± 21%  -14.29% (p=0.002 n=10)
Pool/many,_same_fee-16   40.38k ±  0%   40.03k ±  0%   -0.86% (p=0.000 n=10)
Pool/many,_incr_fee-16   40.38k ±  0%   40.04k ±  0%   -0.85% (p=0.000 n=10)
Pool/one,_same_fee-16                    23.00 ±  4%
geomean                  3.574k          969.8         -5.55%

Signed-off-by: Roman Khimov <roman@nspcc.ru>
2024-08-24 22:41:48 +03:00
..
base.go [#2442] English Check 2022-05-04 19:48:27 +03:00
batch.go [#2442] English Check 2022-05-04 19:48:27 +03:00
batch_test.go storage: expose private storage map for more efficient MPT batch 2022-02-17 23:41:10 +03:00
bench_test.go mpt: use BinWriter.Grow() instead of custom buffer 2021-08-10 09:34:05 +03:00
billet.go *: replace slice.Copy with bytes.Clone 2024-03-05 13:54:10 +03:00
billet_test.go *: use require.ErrorIs instead of require.True(t, error.Is()) 2023-05-04 17:03:47 +03:00
branch.go [#2442] English Check 2022-05-04 19:48:27 +03:00
compat_test.go *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
doc.go *: apply go 1.19 formatter heuristics 2022-08-09 15:37:52 +03:00
empty.go *: replace interface{} with any keyword 2023-04-04 13:22:42 +03:00
extension.go *: replace interface{} with any keyword 2023-04-04 13:22:42 +03:00
hash.go [#2442] English Check 2022-05-04 19:48:27 +03:00
helpers.go [#2442] English Check 2022-05-04 19:48:27 +03:00
helpers_test.go core: implement statesync module 2021-09-07 19:43:27 +03:00
leaf.go limits: new package with storage limits 2022-07-08 23:30:30 +03:00
node.go [#2442] English Check 2022-05-04 19:48:27 +03:00
node_test.go mpt: add the notion of MPT mode 2022-02-10 19:15:18 +03:00
proof.go *: replace slice.Copy with bytes.Clone 2024-03-05 13:54:10 +03:00
proof_test.go mpt: add the notion of MPT mode 2022-02-10 19:15:18 +03:00
trie.go *: use clear() to clear maps 2024-08-24 22:41:48 +03:00
trie_store.go *: replace slice.Copy with bytes.Clone 2024-03-05 13:54:10 +03:00
trie_store_test.go core: support Store interface over MPT 2022-04-29 16:10:04 +03:00
trie_test.go storage: simplify (*MemCachedStore).Put/Delete interface 2022-02-16 18:24:20 +03:00