Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ways to accelerate the simulator? #4442

Closed
4 tasks
npinto opened this issue May 29, 2019 · 4 comments
Closed
4 tasks

Ways to accelerate the simulator? #4442

npinto opened this issue May 29, 2019 · 4 comments
Labels
C:Simulations T: Performance Performance improvements

Comments

@npinto
Copy link
Contributor

npinto commented May 29, 2019

We are looking into ways to accelerate the simulator (for deeper explorations of the state space) and we found that aside from the GC, the biggest bottleneck seems to be the type reflection used in go-amino.

Would it be possible to have a flag to somehow disable this in the simulator CLI ?

Here are the results of the profiler on a fast sim test run. The command used was go test -cpuprofile cpu.prof -bench -mod=readonly github.com/cosmos/cosmos-sdk/simapp -run TestFullAppSimulation -SimulationEnabled=true -SimulationNumBlocks=100 -SimulationBlockSize=200 -SimulationCommit=true -SimulationSeed=99 -SimulationPeriod=5 -v -timeout 24h:

profile001.pdf

image

/cc @fernand

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

/cc @liamsi? Will this be possible soon?

@liamsi
Copy link
Contributor

liamsi commented Jun 5, 2019

As soon as amino is fully protobuf compatible, one could use protobuf and amino could basically be just the "codec" to decorate proto messages with their prefix bytes (and wrap them in sth. similar as proto.Any).

See the lengthly discussion here tendermint/go-amino#267. And this PR is a step closer tendermint/go-amino#276 to achieving this. After everything is properly tested with amino, we could first update the amino version, and then, start writing proto files for each type (which will still be a lot of work).

@ValarDragon
Copy link
Contributor

If I understand the profiling result correctly, it appears that 80% of CPU time is attributable to the delegatorShares invariant checks. Why not only check that with small probability every block?

@fedekunze fedekunze added the T: Performance Performance improvements label Aug 11, 2019
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Simulations T: Performance Performance improvements
Projects
None yet
Development

No branches or pull requests

6 participants