Go to file
Dev Ojha 61dd71ed87
perf: Speedup to params simulation (#9481)
## Description

In Osmosis' simulation, we were observing that a large percent of the time was spent within SimulateParamChangeProposalContent, in particular within the composed key function. This is from a trace of our simulator running for 10 minutes:

<img width="931" alt="Screenshot 2021-06-08 at 2 32 28 PM" src="https://user-images.githubusercontent.com/6440154/121238788-16cdd000-c85e-11eb-8251-94537e69f8ce.png">

~This change lowers the number of calls to ComposedKey() by a factor of 3, and speeds up the underlying ComposedKey function. (sprintf is not particularly efficient for string concatenation, https://dev.to/pmalhaire/concatenate-strings-in-golang-a-quick-benchmark-4ahh ). After these change, the effect of ComposedKey() can no longer be seen in the profiler outputs.~

~This change does not change the result of the simulator on a given seed.~

See https://github.com/cosmos/cosmos-sdk/pull/9481#issuecomment-857119210 for description of changes.

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2021-06-17 07:42:07 +00:00
.github build(deps): bump codecov/codecov-action from 1.5.0 to 1.5.2 (#9482) 2021-06-15 15:23:16 +02:00
baseapp feat: add header hash to `Context` (#9390) 2021-05-26 08:36:42 +00:00
client refactor(client): add client/Context.Codec and deprecate JSONCodec (#9498) 2021-06-11 11:49:39 +00:00
codec Rename clientCtx.JSONMarshaler to JSONCodec (#9251) 2021-05-03 14:45:47 +00:00
contrib chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
cosmovisor chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
crypto chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
docs build(deps): bump postcss from 7.0.35 to 7.0.36 in /docs (#9525) 2021-06-17 05:52:08 +00:00
internal/conv internal/conv: fix wrong string to bytes implementation (#9141) 2021-04-19 14:51:05 +01:00
proto/cosmos revert: Turn staking power reduction into an on-chain param (#9495) 2021-06-14 14:45:15 +00:00
scripts scripts: indent multiline commands (#8706) 2021-02-25 20:57:41 +00:00
server feat: grpc-web add CORS handler (#9493) 2021-06-16 10:33:42 +00:00
simapp fix: testnet cli command update genesis supply (#9497) 2021-06-14 09:56:25 +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 feat: add `RefundGas` function to `GasMeter` (#9403) 2021-06-02 15:14:15 +00:00
telemetry v043 audit changes for telemetry/ (#9297) 2021-05-11 12:28:47 +00:00
tests test: fix mockgen version (#9127) 2021-05-25 09:18:59 +00:00
testutil refactor(client): add client/Context.Codec and deprecate JSONCodec (#9498) 2021-06-11 11:49:39 +00:00
third_party/proto Any: update and test String method (#8854) 2021-03-12 12:24:07 +00:00
types fix: Handle MAX_INT_256 (#9511) 2021-06-16 14:18:02 +00:00
version v043 audit changes for version (#9296) 2021-05-11 13:08:23 +00:00
x perf: Speedup to params simulation (#9481) 2021-06-17 07:42:07 +00: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 style: fix lint errors and update lint timeout (#9464) 2021-06-08 16:27:39 +00:00
.goreleaser.yml ci: automate release post tag push (#6230) 2020-05-25 20:02:08 +02:00
.markdownlint.json chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
.markdownlintignore chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
.mergify.yml ci: use title+body for commit message (#9496) 2021-06-11 11:56:00 -07:00
CHANGELOG.md perf: Speedup to params simulation (#9481) 2021-06-17 07:42:07 +00:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#7381) 2020-09-28 11:28:30 +02:00
CONTRIBUTING.md docs: update contributing pull request process (#9472) 2021-06-09 17:37:58 -07: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 fix: make proto-format (#9470) 2021-06-07 14:45:55 +00:00
README.md chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
SECURITY.md chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00:00
STABLE_RELEASES.md chore: add markdownlint to lint commands (#9353) 2021-05-27 15:31:04 +00: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 build(deps): bump github.com/spf13/viper from 1.7.1 to 1.8.0 (#9524) 2021-06-17 06:33:29 +00:00
go.sum build(deps): bump github.com/spf13/viper from 1.7.1 to 1.8.0 (#9524) 2021-06-17 06:33:29 +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.