Go to file
Cuong Manh Le 4f306fca4d
store/cachekv: reduce allocation with []byte -> string in map keys (#9275)
Uses internal/conv throughout store/kv which shows performance gains.

Benchmark for store/cachekv:

name                          old time/op    new time/op    delta
CacheKVStoreIterator500-8       23.4µs ± 1%    23.3µs ± 1%     ~     (p=0.095 n=5+5)
CacheKVStoreIterator1000-8      46.7µs ± 1%    46.2µs ± 0%   -0.96%  (p=0.008 n=5+5)
CacheKVStoreIterator10000-8      457µs ± 1%     455µs ± 1%     ~     (p=1.000 n=5+5)
CacheKVStoreIterator50000-8     2.59ms ± 2%    2.47ms ± 1%   -4.64%  (p=0.008 n=5+5)
CacheKVStoreIterator100000-8    7.33ms ± 3%    6.91ms ± 1%   -5.75%  (p=0.008 n=5+5)
CacheKVStoreGetNoKeyFound-8      423ns ± 1%     391ns ± 2%   -7.41%  (p=0.008 n=5+5)
CacheKVStoreGetKeyFound-8        267ns ± 3%     264ns ± 2%     ~     (p=0.595 n=5+5)

name                          old alloc/op   new alloc/op   delta
CacheKVStoreIterator500-8       5.18kB ± 0%    5.18kB ± 0%     ~     (all equal)
CacheKVStoreIterator1000-8      9.29kB ± 0%    9.29kB ± 0%     ~     (p=0.079 n=4+5)
CacheKVStoreIterator10000-8     85.2kB ± 0%    84.9kB ± 0%   -0.30%  (p=0.008 n=5+5)
CacheKVStoreIterator50000-8      468kB ± 1%     458kB ± 0%   -2.17%  (p=0.008 n=5+5)
CacheKVStoreIterator100000-8    1.16MB ± 1%    1.10MB ± 0%   -5.34%  (p=0.008 n=5+5)
CacheKVStoreGetNoKeyFound-8       222B ± 1%      214B ± 0%   -3.78%  (p=0.008 n=5+5)
CacheKVStoreGetKeyFound-8        51.0B ± 0%     51.0B ± 0%     ~     (all equal)

name                          old allocs/op  new allocs/op  delta
CacheKVStoreIterator500-8         13.0 ± 0%      13.0 ± 0%     ~     (all equal)
CacheKVStoreIterator1000-8        13.0 ± 0%      13.0 ± 0%     ~     (all equal)
CacheKVStoreIterator10000-8       51.0 ± 0%      43.0 ± 0%  -15.69%  (p=0.008 n=5+5)
CacheKVStoreIterator50000-8      1.22k ± 4%     0.94k ± 1%  -23.04%  (p=0.008 n=5+5)
CacheKVStoreIterator100000-8     6.48k ± 4%     4.85k ± 1%  -25.12%  (p=0.008 n=5+5)
CacheKVStoreGetNoKeyFound-8       5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.008 n=5+5)
CacheKVStoreGetKeyFound-8         2.00 ± 0%      2.00 ± 0%     ~     (all equal)

Benchmark for x/auth/keeper:

name                            old time/op    new time/op    delta
AccountMapperGetAccountFound-8    1.27µs ± 3%    1.26µs ± 1%    ~     (p=0.270 n=5+5)
AccountMapperSetAccount-8         3.53µs ± 0%    3.44µs ± 1%  -2.59%  (p=0.008 n=5+5)

name                            old alloc/op   new alloc/op   delta
AccountMapperGetAccountFound-8      440B ± 0%      440B ± 0%    ~     (all equal)
AccountMapperSetAccount-8         2.13kB ± 0%    2.08kB ± 0%  -2.31%  (p=0.008 n=5+5)

name                            old allocs/op  new allocs/op  delta
AccountMapperGetAccountFound-8      10.0 ± 0%      10.0 ± 0%    ~     (all equal)
AccountMapperSetAccount-8           42.0 ± 0%      38.0 ± 0%  -9.52%  (p=0.008 n=5+5)

Fixes #9274
2021-05-06 06:33:01 -07:00
.github Add labeler action (#9204) 2021-04-27 14:52:19 -04:00
baseapp Remove ServiceMsgs from ADR-031 (#9139) 2021-04-30 11:00:47 +00:00
client Rename memo to note inside CLI (#9134) 2021-05-04 09:00:54 +00:00
codec Rename clientCtx.JSONMarshaler to JSONCodec (#9251) 2021-05-03 14:45:47 +00:00
contrib Remove ServiceMsgs from ADR-031 (#9139) 2021-04-30 11:00:47 +00:00
cosmovisor codec: Rename codec and marshaler interfaces (#9226) 2021-04-29 10:46:22 +00:00
crypto crypto/types: optimize compact bit array one count (#9216) 2021-04-30 21:08:14 +00:00
docs Update `memo` usage docs (#9265) 2021-05-06 08:47:02 +00:00
internal/conv internal/conv: fix wrong string to bytes implementation (#9141) 2021-04-19 14:51:05 +01:00
proto/cosmos Update `memo` usage docs (#9265) 2021-05-06 08:47:02 +00:00
scripts scripts: indent multiline commands (#8706) 2021-02-25 20:57:41 +00:00
server Rename clientCtx.JSONMarshaler to JSONCodec (#9251) 2021-05-03 14:45:47 +00:00
simapp Rename clientCtx.JSONMarshaler to JSONCodec (#9251) 2021-05-03 14:45:47 +00:00
snapshots snapshots: document use of ioutil.TempDir() (#8508) 2021-02-04 09:54:01 +00:00
std Add ADR 031 BaseApp and codec infrastructure (#7519) 2020-10-15 13:07:59 +00:00
store store/cachekv: reduce allocation with []byte -> string in map keys (#9275) 2021-05-06 06:33:01 -07:00
telemetry Minor Code Cleanup - gRPC queries (#6862) 2020-07-28 12:53:35 +00:00
tests codec: Rename codec and marshaler interfaces (#9226) 2021-04-29 10:46:22 +00:00
testutil Rename clientCtx.JSONMarshaler to JSONCodec (#9251) 2021-05-03 14:45:47 +00:00
third_party/proto Any: update and test String method (#8854) 2021-03-12 12:24:07 +00:00
types Update `memo` usage docs (#9265) 2021-05-06 08:47:02 +00:00
version Set proper default command output (#8628) 2021-04-17 00:21:32 +00:00
x x/staking: lazily get consensus key address (#9264) 2021-05-05 11:28:37 -07:00
.build.sh fix library file path (#8301) 2021-01-12 10:08:42 +00:00
.clang-format Fix clang-format to specific version (#7350) 2020-10-27 10:04:34 +00:00
.codecov.yml CI: Fix codecov flag project config (#7994) 2020-11-20 09:13:25 -05:00
.deepsource.toml chore: refactor code quality issues (#8932) 2021-03-22 09:30:27 +00:00
.dockerignore Add basic Dockerfile to build all binaries and export gaiad 2018-04-10 12:39:47 +02:00
.gitattributes Merge PR #6426: Migrate API Server 2020-06-15 13:39:09 -04:00
.gitignore All Makefile proto commands use Docker (#7931) 2020-11-13 16:36:58 +00:00
.golangci.yml build(deps): bump github.com/otiai10/copy from 1.5.0 to 1.5.1 (#9077) 2021-04-09 14:09:25 +00:00
.goreleaser.yml ci: automate release post tag push (#6230) 2020-05-25 20:02:08 +02:00
.mergify.yml Update mergify (#8784) 2021-03-05 12:45:18 +00:00
CHANGELOG.md Rename memo to note inside CLI (#9134) 2021-05-04 09:00:54 +00:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#7381) 2020-09-28 11:28:30 +02:00
CONTRIBUTING.md update contributor docs (#9190) 2021-04-28 13:02:52 +00:00
Dockerfile remove plantuml install in docker (#9059) 2021-04-06 19:04:00 +00:00
LICENSE Add README.md to Basecoin; Update licenses 2018-01-28 18:17:19 -08:00
Makefile setup: reuses proto container (#9192) 2021-04-26 11:15:46 +00:00
README.md Remove IBC from the SDK (#8735) 2021-03-04 13:11:34 +00:00
SECURITY.md Adding disclosure process to security.md (#9086) 2021-04-13 07:21:51 +00:00
STABLE_RELEASES.md Stable Releases: Definition and Process (#6394) 2020-07-14 10:28:53 +02:00
buf.yaml x/upgrade: remove support for time based upgrades (#8849) 2021-03-14 01:03:01 +00:00
docker-compose.yml buildsystem: simplify Makefile and ci automation (#7189) 2020-08-31 15:39:05 +02:00
go.mod bump iavl to 0.16.0 (#9261) 2021-05-05 13:46:51 +00:00
go.sum bump iavl to 0.16.0 (#9261) 2021-05-05 13:46:51 +00:00

README.md

Cosmos SDK

banner

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.

Interblockchain Communication (IBC)

The IBC module for the SDK has moved to its own repository. Go there to build and integrate with the IBC module.

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.