laconicd-deprecated/x/evm
Emmanuel T Odeke 8333765b27
x/evm/keeper: save 24B with Go in-condition variable idiom (#828)
* x/evm/keeper: save 24B with Go in-condition variable idiom

The prior code doubly invoked (*ethereum/go-ethereum/core/types.Transaction).To()
which is quite expensive, and firstly copies 20 bytes each time, then
that gets rounded up to the proper size class/pointer alignment so on
64-bit machines 20B -> 24B.

Isolating a benchmark for this code per issue #826 shows this saves
quite a bit of bytes and some nano seconds which all count up towards
the transactions per seconds being processed:

```shell
$ benchstat before.txt after.txt
name        old time/op    new time/op    delta
CopyAddr-8    38.4ns ± 3%    19.3ns ± 3%  -49.66%  (p=0.000 n=10+10)

name        old alloc/op   new alloc/op   delta
CopyAddr-8     48.0B ± 0%     24.0B ± 0%  -50.00%  (p=0.000 n=10+10)

name        old allocs/op  new allocs/op  delta
CopyAddr-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
```

Fixes #826

* changelog

* lint

* Revert stray changes that were used in testing

* rm log

Co-authored-by: Federico Kunze Küllmer <federico.kunze94@gmail.com>
2021-12-14 00:51:36 +01:00
..
atlas docs: banner & other (#607) 2021-09-29 18:15:55 +02:00
client feat: add raw ethereum tx CLI (#712) 2021-11-02 12:20:19 +01:00
keeper x/evm/keeper: save 24B with Go in-condition variable idiom (#828) 2021-12-14 00:51:36 +01:00
simulation evm: fixed commented out simulations, pubsub, and handler tests (#655) 2021-10-11 13:09:53 +02:00
spec docs: update EVM spec (#824) 2021-12-10 20:15:17 +01:00
types tests: eth_sendRawTx (#804) 2021-12-01 09:38:59 +01:00
genesis_test.go all: bump SDK to v0.43.0-rc0 (#194) 2021-06-29 13:02:21 -04:00
genesis.go evm: remove tx logs and block bloom from chain state (#556) 2021-09-15 09:45:03 +00:00
handler_test.go evm: clear access list for each transaction (#802) 2021-11-30 12:36:10 +01:00
handler.go evm: rm recover (#542) 2021-09-09 09:10:33 +00:00
module.go feat: store migration setup (#794) 2021-11-29 16:46:20 +01:00