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

Destroy tx sets outside of lock. #4761

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mtrippled
Copy link
Collaborator

@mtrippled mtrippled commented Oct 12, 2023

High Level Overview of Change

This is a performance enhancement that moves destruction of objects that are time consuming to destroy outside of locks.

As transaction volume increases, so does the size of transaction sets for each ledger. This makes it more time-consuming to destroy. Prior to the change, they were destroyed synchronously while in consensus operations, which directly caused consensus to take longer. This change moves unused tx sets into a function that executes on the job queue. Destruction is automatic that way.

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Performance Improvement
  • Release

Throughput increases after the change. Also, the duration of consensus is reduced under high volumes, such as >4000/s.

Note: This depends on re-introduction of #4505.

Copy link
Collaborator

@scottschurr scottschurr left a comment

Choose a reason for hiding this comment

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

This looks pretty good. I left a few comments for your consideration. Feel free to push back on any of them.

FWIW, I did confirm that destroying a std::vector<TxSet_t> occasionally can take over a 100 microseconds. So I understand the motivation for the change.

src/ripple/consensus/Consensus.h Outdated Show resolved Hide resolved
src/ripple/consensus/Consensus.h Outdated Show resolved Hide resolved
src/ripple/consensus/Consensus.h Show resolved Hide resolved
src/ripple/app/consensus/RCLConsensus.h Outdated Show resolved Hide resolved
src/ripple/app/consensus/RCLConsensus.h Show resolved Hide resolved
src/ripple/consensus/Consensus.h Outdated Show resolved Hide resolved
src/test/csf/Peer.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@scottschurr scottschurr left a comment

Choose a reason for hiding this comment

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

👍 Looks good as far as I'm concerned. However clang-format is complaining. If you want you can cherry-pick the topmost commit here which will hopefully deal with the clang-format: https://github.com/scottschurr/rippled/commits/markt-garbage

@mtrippled mtrippled added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Nov 29, 2023
@intelliot intelliot modified the milestones: TPS, 2.0.1 Nov 29, 2023
@intelliot intelliot added Perf Attn Needed Attention needed from RippleX Performance Team and removed Performance/Resource Improvement labels Jan 10, 2024
@intelliot intelliot modified the milestones: 2.0.1, 2.1.0 (Feb 2024) Jan 10, 2024
@intelliot
Copy link
Collaborator

Internal tracker: RPFC-84

@mtrippled - could you resolve the merge conflicts?

@intelliot intelliot added Perf Test Desired (Optional) RippleX Perf Team should look at this PR. The PR will not necessarily wait for testing to finish and removed Perf Attn Needed Attention needed from RippleX Performance Team labels Jan 25, 2024
@intelliot
Copy link
Collaborator

Currently blocked because this depends on #4505 (which was reverted)

@intelliot intelliot added Blocked and removed Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. labels Jan 25, 2024
@intelliot intelliot modified the milestones: 2.1.0 (Mar 2024), TPS Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Perf Test Desired (Optional) RippleX Perf Team should look at this PR. The PR will not necessarily wait for testing to finish
Projects
Status: 📋 Backlog
Development

Successfully merging this pull request may close these issues.

4 participants