forked from cerc-io/laconicd-deprecated
a2f246c2a6
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 |
||
---|---|---|
.. | ||
abci.go | ||
benchmark_test.go | ||
context_stack.go | ||
grpc_query_test.go | ||
grpc_query.go | ||
hooks_test.go | ||
hooks.go | ||
keeper_test.go | ||
keeper.go | ||
migrations.go | ||
msg_server.go | ||
params_test.go | ||
params.go | ||
state_transition_benchmark_test.go | ||
state_transition_test.go | ||
state_transition.go | ||
statedb_benchmark_test.go | ||
statedb_test.go | ||
statedb.go | ||
utils_test.go | ||
utils.go |