neoneo-go/pkg
Roman Khimov ae071d4542 storage: introduce PutChangeSet and use it for Persist
We're using batches in wrong way during persist, we already have all changes
accumulated in two maps and then we move them to batch and then this is
applied. For some DBs like BoltDB this batch is just another MemoryStore, so
we essentially just shuffle the changeset from one map to another, for others
like LevelDB batch is just a serialized set of KV pairs, it doesn't help much
on subsequent PutBatch, we just duplicate the changeset again.

So introduce PutChangeSet that allows to take two maps with sets and deletes
directly. It also allows to simplify MemCachedStore logic.

neo-bench for single node with 10 workers, LevelDB:

  Reference:

  RPS    30189.132 30556.448 30390.482 ≈ 30379    ±  0.61%
  TPS    29427.344 29418.687 29434.273 ≈ 29427    ±  0.03%
  CPU %     33.304    27.179    33.860 ≈    31.45 ± 11.79%
  Mem MB   800.677   798.389   715.042 ≈   771    ±  6.33%

  Patched:

  RPS    30264.326 30386.364 30166.231 ≈ 30272    ± 0.36% ⇅
  TPS    29444.673 29407.440 29452.478 ≈ 29435    ± 0.08% ⇅
  CPU %     34.012    32.597    33.467 ≈   33.36  ± 2.14% ⇅
  Mem MB   549.126   523.656   517.684 ≈  530     ± 3.15% ↓ 31.26%

BoltDB:

  Reference:

  RPS    31937.647 31551.684 31850.408 ≈ 31780    ±  0.64%
  TPS    31292.049 30368.368 31307.724 ≈ 30989    ±  1.74%
  CPU %     33.792    22.339    35.887 ≈    30.67 ± 23.78%
  Mem MB  1271.687  1254.472  1215.639 ≈  1247    ±  2.30%

  Patched:

  RPS    31746.818 30859.485 31689.761 ≈ 31432    ± 1.58% ⇅
  TPS    31271.499 30340.726 30342.568 ≈ 30652    ± 1.75% ⇅
  CPU %     34.611    34.414    31.553 ≈    33.53 ± 5.11% ⇅
  Mem MB  1262.960  1231.389  1335.569 ≈  1277    ± 4.18% ⇅
2021-08-12 17:42:16 +03:00
..
compiler native: drop Refuel method from GAS 2021-08-05 10:27:13 +03:00
config config: update mainnet magic 2021-07-21 14:42:26 +03:00
consensus consensus: fix nonce handling 2021-07-21 19:06:19 +03:00
core storage: introduce PutChangeSet and use it for Persist 2021-08-12 17:42:16 +03:00
crypto keys: trivial code simplification 2021-07-21 17:05:49 +03:00
encoding util: move ArrayReverse into package of its own 2021-07-19 22:57:55 +03:00
interop native: drop Refuel method from GAS 2021-08-05 10:27:13 +03:00
io io: add Grow to BinWriter 2021-08-09 12:05:31 +03:00
network Merge pull request #2118 from nspcc-dev/neopt2 2021-08-10 13:29:40 +03:00
rpc core: implement dynamic NEP17 balances tracking 2021-07-29 10:23:01 +03:00
services notary: fix possible deadlock in UpdateNotaryNodes 2021-07-23 14:48:00 +03:00
smartcontract Merge pull request #2093 from nspcc-dev/states-exchange/drop-nep17-balance-state 2021-07-29 19:08:42 +03:00
util slice: introduce common Copy helper 2021-07-19 22:57:55 +03:00
vm stackitem: serialize integers to the pre-allocated slice 2021-08-06 11:59:24 +03:00
wallet wallet: use named constants in Seek 2021-07-29 17:11:50 +03:00