neo-go/pkg/vm/stackitem
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
..
immutable.go vm: support immutable compound types 2022-05-31 08:07:50 +03:00
item.go *: make use of min/max where appropriate 2024-08-23 22:11:29 +03:00
item_test.go vm: allow to make stackitem from *Uint160 and *Uint256 2023-05-17 11:16:32 +03:00
json.go *: use multierror wrapping where possible 2024-03-05 13:54:10 +03:00
json_test.go vm: reduce maximum stckitem size 2023-11-13 20:40:30 +03:00
reference.go vm: embed reference counter in compound items 2021-08-13 14:41:26 +03:00
serialization.go *: use clear() to clear maps 2024-08-24 22:41:48 +03:00
serialization_test.go vm: add default limit to SI serialization context 2023-11-22 19:39:01 +03:00
type.go vm: stringify InteropInterface stackitem type as InteropInterface 2022-05-25 13:20:21 +03:00
type_test.go stackitem: allow to convert type from string 2020-07-31 16:07:16 +03:00