Given that AccAddress is a []byte type, and its .String() method is quite expensive, continuously invoking the method doesn't easily provide a way for the result to be memoized. In memory profiles from benchmarking OneBankSendTxPerBlock and run for a while, it showed >2GiB burnt and SendCoins consuming a bunch of memory: >2GiB. This change introduces a simple global cache with a map to intern AccAddress values, so that we quickly look up the expensively computed values. With it, the prior memory profiles are erased, and benchmarks show improvements: ```shell $ benchstat before.txt after.txt name old time/op new time/op delta OneBankSendTxPerBlock-8 1.94ms ± 9% 1.92ms ±11% -1.34% (p=0.011 n=58+57) name old alloc/op new alloc/op delta OneBankSendTxPerBlock-8 428kB ± 0% 365kB ± 0% -14.67% (p=0.000 n=58+54) name old allocs/op new allocs/op delta OneBankSendTxPerBlock-8 6.34k ± 0% 5.90k ± 0% -7.06% (p=0.000 n=58+57) ``` Fixes #8693 Co-authored-by: Alessio Treglia <alessio@tendermint.com> |
||
|---|---|---|
| .github | ||
| baseapp | ||
| client | ||
| codec | ||
| contrib | ||
| cosmovisor | ||
| crypto | ||
| docs | ||
| proto | ||
| scripts | ||
| server | ||
| simapp | ||
| snapshots | ||
| std | ||
| store | ||
| telemetry | ||
| tests | ||
| testutil | ||
| third_party/proto | ||
| types | ||
| version | ||
| x | ||
| .build.sh | ||
| .clang-format | ||
| .codecov.yml | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .golangci.yml | ||
| .goreleaser.yml | ||
| .mergify.yml | ||
| buf.yaml | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| SECURITY.md | ||
| STABLE_RELEASES.md | ||
Cosmos SDK
The Cosmos-SDK is a framework for building blockchain applications in Golang.
It is being used to build Gaia, the first implementation of the Cosmos Hub.
WARNING: The SDK has mostly stabilized, but we are still making some breaking changes.
Note: Requires Go 1.15+
Quick Start
To learn how the SDK works from a high-level perspective, go to the SDK Intro.
If you want to get started quickly and learn how to build on top of the SDK, please follow the SDK Application Tutorial. You can also fork the tutorial's repository to get started building your own Cosmos SDK application.
For more, please go to the Cosmos SDK Docs.
Cosmos Hub Mainnet
The Cosmos Hub application, gaia, has moved to its own repository. Go there to join the Cosmos Hub mainnet and more.
Starport
If you are starting a new app or a new module you can use Starport to help you get started and speed up development. If you have any questions or find a bug, feel free to open an issue in the repo.
Disambiguation
This Cosmos-SDK project is not related to the React-Cosmos project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here.
