laconicd/x/evm/keeper
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
..
abci.go evm: remove tx logs and block bloom from chain state (#556) 2021-09-15 09:45:03 +00:00
benchmark_test.go tests: add message call benchmark (#717) 2021-11-08 13:04:49 +00:00
context_stack.go evm: fix panic when transaction is reverted (#650) 2021-10-08 11:29:40 +00:00
grpc_query_test.go evm: clear access list for each transaction (#802) 2021-11-30 12:36:10 +01:00
grpc_query.go fix: improve error message in SendTransaction json-rpc api (#786) 2021-11-26 15:19:28 +01:00
hooks_test.go evm: remove tx logs and block bloom from chain state (#556) 2021-09-15 09:45:03 +00:00
hooks.go all: linter (#532) 2021-09-05 11:03:06 +00:00
keeper_test.go rpc: eth_feeHistory (#734) 2021-11-17 11:58:52 +00:00
keeper.go evm: ForEachStorage semantic not compatible with go-ethereum (#798) 2021-11-30 10:34:33 +00:00
migrations.go feat: store migration setup (#794) 2021-11-29 16:46:20 +01:00
msg_server.go x/evm/keeper: save 24B with Go in-condition variable idiom (#828) 2021-12-14 00:51:36 +01:00
params_test.go chore: un-fork from cosmos (#166) 2021-06-22 06:49:18 -04:00
params.go evm: move ChainConfig to Params (#266) 2021-07-14 05:13:55 -04:00
state_transition_benchmark_test.go evm: refactor dup state transition code (#674) 2021-10-22 19:21:03 +02:00
state_transition_test.go rpc: eth_feeHistory (#734) 2021-11-17 11:58:52 +00:00
state_transition.go evm: clear access list for each transaction (#802) 2021-11-30 12:36:10 +01:00
statedb_benchmark_test.go evm: benchmark evm keeper (#586) 2021-09-24 12:58:22 -03:00
statedb_test.go evm: ForEachStorage semantic not compatible with go-ethereum (#798) 2021-11-30 10:34:33 +00:00
statedb.go evm: clear access list for each transaction (#802) 2021-11-30 12:36:10 +01:00
utils_test.go tests: DynamicFeeTx (#649) 2021-10-19 08:49:29 +00:00
utils.go fix: improve error message in SendTransaction json-rpc api (#786) 2021-11-26 15:19:28 +01:00