Closed keefel closed 2 months ago
Have you guys benchmarked this work yet? Pretty exciting and stuff we've talked about before, keen to see how well it does as state root is by far the bottleneck...
Have you guys benchmarked this work yet? Pretty exciting and stuff we've talked about before, keen to see how well it does as state root is by far the bottleneck...
Thank you for being so interested. We are currently conducting performance tests and will soon release the relevant data publicly.
Description
This pull request enhances merkleization efficiency by prefetching trie nodes from the database during execution.
Rationale
This pull request can enhance merkleization efficiency by approximately 56% for the BSC network.
Example
We separately tracked the time taken for inserting blocks, executing blocks, and calculating the state root during live sync. We will compare these metrics to gain insights into their performance.
BSC Test Result - Live sync 14K blocks, from 41550000 to 41564139.
Statistical Average
Scatter Plot for Execution Time
Scatter Plot for State Root Calculation Time
Scatter Plot for Total Time
The Prefetch feature boosts state root calculation efficiency during BSC live sync without compromising block execution efficiency. This leads to a 56% decrease in state root calculation time and a 29% reduction in total block insertion time.
opBNB Test Result - Live sync 14K blocks, from 33180000 to 33194139.
Statistical Average
Scatter Plot for Execution Time
Scatter Plot for State Root Calculation Time
Scatter Plot for Total Time
In the case of opBNB, the execution time, state root calculation time, and total time for block insertion are all relatively small. Prefetching optimization doesn't show clear benefits for opBNB. This could be due to the small world state tree of opBNB. When opBNB runs on a machine with 128GB of memory, most trie nodes are already in memory, making prefetch optimization ineffective.
Changes
Notable changes:
Potential Impacts