Commit graph

7 commits

Author SHA1 Message Date
Evgeniy Stratonikov
9712be78fd vm: optimize refcounter
```
name                    old time/op    new time/op    delta
RefCounter_Add-8          9.47ns ± 4%    2.75ns ± 1%   -70.92%  (p=0.000 n=10+9)
RefCounter_AddRemove-8    88.9ns ±20%     5.5ns ± 4%   -93.78%  (p=0.000 n=10+10)

name                    old alloc/op   new alloc/op   delta
RefCounter_Add-8           0.00B          0.00B           ~     (all equal)
RefCounter_AddRemove-8     48.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)

name                    old allocs/op  new allocs/op  delta
RefCounter_Add-8            0.00           0.00           ~     (all equal)
RefCounter_AddRemove-8      2.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
```

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2022-08-23 13:18:06 +03:00
Roman Khimov
18d627e7f7 vm: count map key in the refcounter as well
Thanks @ixje for spotting this.
2022-05-16 16:07:25 +03:00
Elizaveta Chichindaeva
28908aa3cf [#2442] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-05-04 19:48:27 +03:00
Evgeniy Stratonikov
4f98ec2f53 vm: embed reference counter in compound items
```
name              old time/op  new time/op  delta
RefCounter_Add-8  44.8ns ± 4%  11.7ns ± 3%  -73.94%  (p=0.000 n=10+10)
```

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
2021-08-13 14:41:26 +03:00
Roman Khimov
85936de254 vm: don't create reference counter when it's not needed
* invocation stack doesn't need refcounting
 * exception stack doesn't need refcounting
 * evaluation stack always has VM-level refcounter
2021-08-02 22:38:41 +03:00
Anna Shaleva
783f5ecb01 vm: move StackItem to a separate package
closes #912
2020-06-08 13:27:08 +03:00
Evgenii Stratonikov
af2abedd86 vm: implement reference counter
It is convenient to have all reference-counting logic
in a separate struct.
2020-05-12 16:15:14 +03:00