laconicd-deprecated/x/evm/keeper
Emmanuel T Odeke a2f246c2a6
x/evm/keeper: use the fastest slice making idiom for Keeper.EthereumTx.Logs (#827)
Uses the fastest slice making idiom of creating the well known
size of a slice using

    make([]sdk.Attribute, len(response.Logs))
    for i, log := range response.Logs {
        txLogAttrs[i] = ...
    }

instead of

    make([]sdk.Attribute, 0)
    for _, log := range response.Logs {
        txLogAttrs = append(txLogAttrs, ...)
    }

which had a few problems:
1. Using 0 for size then appending is quite slow yet we know the exact size
2. Using append instead of indexing is slower

If we examine the advisory at https://bencher.orijtech.com/perfclinic/sliceupdate/
and the verdict at https://bencher.orijtech.com/perfclinic/sliceupdate/#verdict
this new scheme shows a massive improvement in that call site.

Fixes #825
2021-12-14 00:05:12 +00: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: use the fastest slice making idiom for Keeper.EthereumTx.Logs (#827) 2021-12-14 00:05:12 +00: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