neo-go/pkg/core/native
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
..
native_test native: emit vote/candidate events 2022-05-28 18:44:20 +03:00
nativenames [#2442] English Check 2022-05-04 19:48:27 +03:00
nativeprices core: move NotaryVerificationPrice to a separate package 2021-03-23 13:56:39 +03:00
noderoles [#2442] English Check 2022-05-04 19:48:27 +03:00
compatibility_test.go config: add InitialGASSupply, fix #2073 2021-07-20 16:59:54 +03:00
contract.go Merge pull request #2442 from EliChin/feature/eng_review 2022-05-05 17:12:37 +03:00
crypto.go [#2442] English Check 2022-05-04 19:48:27 +03:00
crypto_test.go core: add murmur32 to CryptoLib native contract 2022-04-05 10:46:52 +03:00
designate.go core: emit notification events in a separate method 2022-05-19 08:48:26 +03:00
doc.go *: add more package-specific documentation 2021-03-19 16:18:45 +03:00
interop.go core: pop native call arguments after call invocation 2022-05-16 09:39:17 +03:00
ledger.go core: adjust Signer to stackitem conversion 2022-05-23 14:01:42 +03:00
management.go bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00
management_test.go core: block destroyed contracts 2022-05-04 13:56:45 +03:00
native_gas.go Merge PR #2488 from nspcc-dev/reorder-neo-gas-distribution 2022-05-13 19:36:34 +03:00
native_neo.go bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00
native_neo_candidate.go [#2442] English Check 2022-05-04 19:48:27 +03:00
native_neo_test.go stackitem: introduce Convertible interface 2021-07-19 15:42:42 +03:00
native_nep17.go bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00
nativenames_test.go [#2442] English Check 2022-05-04 19:48:27 +03:00
neo_types.go stackitem: reusable serialization context 2022-06-02 15:38:39 +03:00
notary.go [#2442] English Check 2022-05-04 19:48:27 +03:00
oracle.go bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00
oracle_types.go [#2442] English Check 2022-05-04 19:48:27 +03:00
oracle_types_test.go stackitem: introduce Convertible interface 2021-07-19 15:42:42 +03:00
policy.go Merge pull request #2442 from EliChin/feature/eng_review 2022-05-05 17:12:37 +03:00
std.go stackitem: reusable serialization context 2022-06-02 15:38:39 +03:00
std_test.go stackitem: reusable serialization context 2022-06-02 15:38:39 +03:00
util.go bigint: don't allocate in ToPreallocatedBytes 2022-06-02 15:38:39 +03:00