neo-go/pkg/core
Roman Khimov 9a06995460 bigint: don't allocate in ToPreallocatedBytes
Turns out, it's almost always allocating because we're mostly dealing with
small integers while the buffer size is calculated in 8-byte chunks here, so
preallocated buffer is always insufficient.

name                   old time/op    new time/op    delta
ToPreallocatedBytes-8    28.5ns ± 7%    19.7ns ± 5%   -30.72%  (p=0.000 n=10+10)

name                   old alloc/op   new alloc/op   delta
ToPreallocatedBytes-8     16.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)

name                   old allocs/op  new allocs/op  delta
ToPreallocatedBytes-8      1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)

Fix StorageItem reuse at the same time. We don't copy when getting values from
the storage, but we don when we're putting them, so buffer reuse could corrupt
old values.
2022-06-02 15:38:39 +03:00
..
block [#2442] English Check 2022-05-04 19:48:27 +03:00
blockchainer [#2442] English Check 2022-05-04 19:48:27 +03:00
chaindump [#2442] English Check 2022-05-04 19:48:27 +03:00
dao bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00
fee vm: add MODMUL and MODPOW opcodes 2022-05-12 14:25:14 +03:00
interop stackitem: reusable serialization context 2022-06-02 15:38:39 +03:00
mempool [#2442] English Check 2022-05-04 19:48:27 +03:00
mempoolevent [#2442] English Check 2022-05-04 19:48:27 +03:00
mpt [#2442] English Check 2022-05-04 19:48:27 +03:00
native bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00
state stackitem: reusable serialization context 2022-06-02 15:38:39 +03:00
stateroot core, rpc: support [invokefunction, invokescript, invokecontractverify]historic 2022-04-29 16:10:04 +03:00
statesync storage: drop (KeyPrefix).Bytes() API 2022-02-18 15:19:57 +03:00
storage core: avoid concurrent map r/w during SeekAsync 2022-05-16 12:25:15 +03:00
test_data core: refactor helper test contracts generation 2022-03-30 11:46:29 +03:00
transaction core: do not panic if transaction with empty script is being serialized 2022-05-16 15:19:17 +03:00
basic_chain_test.go core: fix typo in TestCreateBasicChain 2022-04-29 16:10:04 +03:00
bench_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
blockchain.go stackitem: reusable serialization context 2022-06-02 15:38:39 +03:00
blockchain_core_test.go core: use dao-binded cache for native contracts 2022-04-29 16:10:04 +03:00
blockchain_neotest_test.go core: fix broken stateroot storage 2022-04-22 18:37:56 +03:00
doc.go core: add Blockchain event subscription mechanism 2020-05-25 00:27:39 +03:00
helper_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
interop_system.go core: rename hardfork HF_2712_FixSyscallFees 2022-05-26 14:20:48 +03:00
interop_system_core_test.go core: adjust System.Runtime.GetRandom 2022-05-26 14:20:12 +03:00
interop_system_neotest_test.go Merge pull request #2508 from nspcc-dev/snapshot-isolation 2022-05-27 12:44:06 +03:00
interops.go core: adjust System.Runtime.GetRandom 2022-05-26 14:20:12 +03:00
interops_test.go core: use dao-binded cache for native contracts 2022-04-29 16:10:04 +03:00
native_contract_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
native_designate_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
native_management_test.go *: refactor TestCreateBasicChain and its dependencies 2022-03-30 11:32:26 +03:00
native_neo_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
native_policy_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
notary_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
oracle_test.go [#2442] English Check 2022-05-04 19:48:27 +03:00
prometheus.go stateroot: move state-root related logic to core/stateroot 2021-03-09 13:48:29 +03:00
stateroot_test.go core, rpc: support [invokefunction, invokescript, invokecontractverify]historic 2022-04-29 16:10:04 +03:00
statesync_test.go *: refactor TestCreateBasicChain and its dependencies 2022-03-30 11:32:26 +03:00
util.go core: drop GetStandBy* methods 2022-01-31 23:14:38 +03:00
util_test.go core/block: add Nonce field to header 2021-07-15 15:58:49 +03:00