mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 23:25:22 +00:00
9a06995460
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. |
||
---|---|---|
.. | ||
native_test | ||
nativenames | ||
nativeprices | ||
noderoles | ||
compatibility_test.go | ||
contract.go | ||
crypto.go | ||
crypto_test.go | ||
designate.go | ||
doc.go | ||
interop.go | ||
ledger.go | ||
management.go | ||
management_test.go | ||
native_gas.go | ||
native_neo.go | ||
native_neo_candidate.go | ||
native_neo_test.go | ||
native_nep17.go | ||
nativenames_test.go | ||
neo_types.go | ||
notary.go | ||
oracle.go | ||
oracle_types.go | ||
oracle_types_test.go | ||
policy.go | ||
std.go | ||
std_test.go | ||
util.go |