bnb-chain / reth

BSC and opBNB client based on the Reth fork
Apache License 2.0
72 stars 19 forks source link

feat: state cache for execution #153

Closed forcodedancing closed 2 weeks ago

forcodedancing commented 1 month ago

Description

Try to improve the speed of execution. Use the flag optimize.enable-execution-cache to enable the cache for execution.

Rationale

Implement a layer of cache for db access.

Test results:

Compared the execution time of the original version and the cached version, for block range between (41932000, 41942000]. For each test the machine is rebooted (at the beginning it takes more time to execute) .

1) Time decrease of every 100 blocks

image

Cached version has shorter total execution time. The decrease of execution for every 100 blocks is about 15% ~ 20%.

Also tracked the cache hit rate for long-run (different block ranges).

1) Cache hit rate

image

Account hit rate is about 45%, and storage hit rate is about 30%.

Example

NA

Changes

Notable changes:

Potential Impacts