-
Notifications
You must be signed in to change notification settings - Fork 649
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
Improve block generation performance #1251
Conversation
IMO at this time 4% replay time hurts more than block generation performance. |
To improve replay performance, we need to change |
Update: it's even slower to replay after changed By the way, I tried to extract trx signees before pushing a block with this commit: abitmore@7309e85, don't know if it's worthwhile. With the patch, I assume that the performance will be better when there is frequent chain reorganization, but perhaps will have reduced performance under normal conditions due to additional data copy, although both affect validation nodes only (nodes that configured with a witness_id or started with Thoughts? |
Yes, at this time the chain is not under any meaningful pressure. In the long run, faster block generation means higher throughput, aka higher TPS. This PR is the first step towards multi-threaded signature verification. If we're going to do another stress testing, I think we need something like this. |
I guess the performance loss is due to additional object construction when applying transactions. I guess performance can be restored by moving the |
Rebased. The code is much cleaner now, and replay performance is fine. @pmconrad please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good first steps.
libraries/chain/include/graphene/chain/protocol/transaction.hpp
Outdated
Show resolved
Hide resolved
and * updated get_signature_keys() to return a const reference, * get_signature_keys() will update signees on first call, * modified test cases and wallet.cpp accordingly, * no longer construct a new signed_transaction object before pushing
and removed unused new added constructor and _get_signature_keys() function from signed_transaction struct
Updated |
Improved block generating performance by caching public keys extracted from transaction signatures which reduces number of ECDSA verification calls.
Side effect: due to additional data copy, replay is slightly slower, profiling data says the difference is around 4%.Update: latest code avoided the performance penalty.Perhaps todo:
extract signing keys for popped transactions in the first place.Update: it's done implicitly.