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

perf: optimize chain commit performance for multi-database #2509

Merged
merged 9 commits into from
Jun 18, 2024

Conversation

jingjunLi
Copy link
Contributor

@jingjunLi jingjunLi commented Jun 6, 2024

Description

In a multi-database, the performance of the chain commit process degrades. The chain commit process mainly involves writing data; the performance drops when using multiple databases.

Rationale

Optimization

  • The BlockStore makes multiple calls to the rawdb interface, performing multiple batch writes. Encapsulating these into a single batch will improve performance.
  • Currently, the process writes to BlockStore first and then to chaindb in a sequential manner. Parallelizing these two database writes using go routines will optimize the write process.

Impact
These optimizations result in a 10% performance improvement during the commit phase in a multi-database setup.

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

@jingjunLi jingjunLi changed the title perf: Optimize Chain Commit Performance for Multi-Database perf: optimize chain commit performance for multi-database Jun 7, 2024
core/blockchain.go Outdated Show resolved Hide resolved
Copy link
Contributor

@sysvm sysvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@flywukong flywukong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@fynnss fynnss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zzzckck zzzckck merged commit 7b08a70 into bnb-chain:develop Jun 18, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

5 participants