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

Profile and Optimize Mining Code #3014

Closed
gregorycoppola opened this issue Jan 24, 2022 · 2 comments
Closed

Profile and Optimize Mining Code #3014

gregorycoppola opened this issue Jan 24, 2022 · 2 comments

Comments

@gregorycoppola
Copy link
Contributor

gregorycoppola commented Jan 24, 2022

#3012 discusses how blocks often have few tx's in them.

This is a result of two things:

  1. the timeout times to stop processing
  2. the speed of tx processing

I have measured processing speed on my GCP box as

INFO [1643037789.034557] [src/chainstate/stacks/miner.rs:1934] [main] num_considered 269 seconds_elapsed 183.046 fraction 0.6804684014869888 

This is about 1.47 transactions per second. This means that, to put 1k tx's in a block, it would take 680s=11minutes. This means that it will be hard to put 1k tx's in most blocks.

Maybe we can improve processing speed, to drastically fill more blocks. Eg. we can pre-cache the MARF look-ups that will be needed for a given set of mempool tx's before mining begins.

@gregorycoppola
Copy link
Contributor Author

profile002

Here is a profile I made.

Looks like query_row_and_then takes up most of the time, but not sure if the graph is showing the relationships right, in that it looks like these calls are outside of process_transaction, but that might not be true.

@jcnelson
Copy link
Member

jcnelson commented Sep 1, 2022

Closing in favor of your other issues related to improving the miner performance

@jcnelson jcnelson closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants