cosmos-sdk/types
Emmanuel T Odeke abe3e0c6da
perf: all: remove unnecessary allocations from strings.Builder.WriteString(fmt.Sprintf(...)) (#13230)
This change removes a code pattern that I noticed while on a late night
audit of cosmovisor in which
strings.Builder.WriteString(fmt.Sprintf(...))
calls were being made, yet that's counterproductive to using fmt.Fprintf
which will check whether the writer implements .WriteString and then
avoids the need to firstly build a string using fmt.Sprintf.

The performance wins from this change transcend all dimensions as
exhibited below:

```shell
$ benchstat before.txt after.txt
name            old time/op    new time/op    delta
DetailString-8    5.48µs ±23%    4.40µs ±11%  -19.79%  (p=0.000 n=20+17)

name            old alloc/op   new alloc/op   delta
DetailString-8    2.63kB ± 0%    2.11kB ± 0%  -19.76%  (p=0.000 n=20+20)

name            old allocs/op  new allocs/op  delta
DetailString-8      63.0 ± 0%      50.0 ± 0%  -20.63%  (p=0.000 n=20+20)
```

Fixes #13229
2022-09-09 21:57:46 +00:00
..
address docs: updates outdated docs (#12014) 2022-05-31 08:59:38 -04:00
bech32 chore: move server.GenerateCoinKey and server.GenerateSaveCoinKey to … (#10957) 2022-01-18 15:24:16 +00:00
errors chore: fix linting issues exposed by fixing golangci-lint (#12895) 2022-08-11 22:00:24 +02:00
grpc Add GRPCBlockHeightHeader in clientCtx gRPC requests (#7021) 2020-08-12 14:42:10 +00:00
kv refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
module refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
msgservice refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
query refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
simulation chore: math lib update and type fixes (#12791) 2022-08-02 11:16:40 +00:00
tx refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
abci.go Merge PR #4613: Only change rootmultistore hash when substore hashes change 2019-06-25 13:11:22 -04:00
abci.pb.go refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
address_race_test.go refactor!: Rename AccAddressFromHex (#11888) 2022-05-06 22:09:36 +00:00
address_test.go chore: gofumpt (#11839) 2022-05-19 10:55:27 +02:00
address.go chore(types): add MustAccAddressFromBech32 util func (#12201) 2022-06-09 12:26:07 -04:00
bench_test.go chore: gofumpt (#11839) 2022-05-19 10:55:27 +02:00
codec.go Remove ServiceMsgs from ADR-031 (#9139) 2021-04-30 11:00:47 +00:00
coin_benchmark_test.go test: fix BenchmarkCoinsAdditionIntersect panic (#9904) 2021-08-11 02:13:17 -07:00
coin_internal_test.go add sorted check for the coins sub/add fun parameter (#9240) 2021-05-05 15:55:28 +00:00
coin_test.go chore: use math.Int instead of math.Int and apply linting (#12702) 2022-07-26 00:24:47 +02:00
coin.go chore: fix linting issues exposed by fixing golangci-lint (#12895) 2022-08-11 22:00:24 +02:00
coin.pb.go refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
config_test.go Deprecate SetFullFundraiserPath in favor of SetPurpose and SetCoinType (#8629) 2021-02-22 15:14:09 +00:00
config.go chore: fix linting issues exposed by fixing golangci-lint (#12895) 2022-08-11 22:00:24 +02:00
context_test.go refactor: create go.mod for simapp (#13130) 2022-09-07 18:14:22 +00:00
context.go refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
dec_coin_test.go fix: prevent nil DecCoin creation when converting Coins to DecCoins (#12903) 2022-08-11 21:39:46 +00:00
dec_coin.go fix: prevent nil DecCoin creation when converting Coins to DecCoins (#12903) 2022-08-11 21:39:46 +00:00
denom_internal_test.go cli: convert coins to smallest unit registered (#7777) 2020-11-16 11:34:54 +00:00
denom.go refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00
events_test.go chore: bump tendermint version (#13148) 2022-09-05 07:39:12 +00:00
events.go perf: all: remove unnecessary allocations from strings.Builder.WriteString(fmt.Sprintf(...)) (#13230) 2022-09-09 21:57:46 +00:00
handler_test.go refactor: create go.mod for simapp (#13130) 2022-09-07 18:14:22 +00:00
handler.go chore: fix linting issues exposed by fixing golangci-lint (#12895) 2022-08-11 22:00:24 +02:00
invariant_test.go types: tests -> test suites migration (#7405) 2020-09-29 13:29:10 +02:00
invariant.go Merge PR #4832: print all failed invariants only 2019-08-05 14:21:44 -04:00
math.go refactor: Move sdk.Dec to math package (#12634) 2022-07-20 15:13:45 +00:00
proto.go refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
queryable.go Merge PR #5421: Refactor Error Handling 2019-12-27 12:57:54 -05:00
result_test.go chore: bump tendermint version (#13148) 2022-09-05 07:39:12 +00:00
result.go refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
router.go refactor!: Remove sdk.Router and refactor baseapp tests (#13005) 2022-08-30 23:50:47 +02:00
staking_test.go revert: Revert "feat: staking config (#10988)" (#11446) 2022-03-24 12:26:25 +01:00
staking.go revert: Revert "feat: staking config (#10988)" (#11446) 2022-03-24 12:26:25 +01:00
store_internal_test.go chore: gofumpt (#11839) 2022-05-19 10:55:27 +02:00
store_test.go chore: gofumpt (#11839) 2022-05-19 10:55:27 +02:00
store.go refactor!: abstractions for snapshot and pruning; snapshot intervals eventually pruned; unit tests (#11496) 2022-04-21 15:30:36 -04:00
tx_msg_test.go refactor!: change GetSigners return type to []sdk.AccAddress (#9915) 2021-08-13 15:34:00 +00:00
tx_msg.go refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +00:00
utils_test.go feat: add FormatTime and ParseTimeString methods (#12995) 2022-08-22 23:53:09 +02:00
utils.go feat: add FormatTime and ParseTimeString methods (#12995) 2022-08-22 23:53:09 +02:00