-
Notifications
You must be signed in to change notification settings - Fork 379
Add benchmarks for for import/validation/production #2579
Conversation
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.
lgtm
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.
Generally looks good, I mainly left some nitpicks.
transaction_validity::{InvalidTransaction, TransactionValidityError}, | ||
}; | ||
|
||
fn create_extrinsics( |
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.
Why don't you use this from the utils?
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.
Yeah this is a bit of a compromise. I am using the test client for the validate block benchmarks and test service for block production and block import since I wanted to reuse the nice convenience features of the test client block builder.
Closes #2048
This PR adds some benchmarks to work on. The requirements are specified in #2048.
The goal is to capture the current performance of block import/block production/block validation.
Transfers
First, we have a benchmark that fills a block with transfer_keep_alive transactions until the block is full.
This block is then built/imported/validated.
1313 transfer transactions per block.
Triecache Enabled:
Triecache Disabled:
Compute/IO
In addition to the benchmarking of blocks with transfer extrinsics, I used the glutton pallet
to fully use the weight of a block with configurable compute/IO part. The glutton pallet will just "burn" the leftover weight
of the current block in the
on_idle
hook of the pallet. The weight consumed for PoV size and timecan be chosen using the glutton pallets extrinsics.
Note: Throughput is not available for this benchmark since we add no extrinsics.
Triecache Enabled:
Triecache Disabled:
Overall, these benchmark results raise some questions. For the benchmarks that use the glutton pallet, I was expecting the PoV size to have a much larger impact
on the execution time.
Edit: Switched out client block import with
execute_block
for a more fair comparison, results make more sense now. Block import is fastest, followed by block production. Validate block is slowest due to the constant decoding of storage values.