8000 Moving mutex to partition level by vlntb · Pull Request #5486 · XRPLF/rippled · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Moving mutex to partition level #5486

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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

vlntb
Copy link
Collaborator
@vlntb vlntb commented Jun 11, 2025

High Level Overview of Change

This change introduces two key optimizations:

  1. Mutex scope reduction — Limits the lock to individual partitions within TaggedCache, reducing contention (see attached diagram illustrating the current bottleneck).
  2. Decoupling — Removes tight coupling between LedgerHistory and TaggedCache, improving modularity and testability.

Lock Contention analysis based on eBPF shows significant improvements:

  • 🔒 Held Mean Time: ↓ 60.17%
  • ⏱ Held Max Time: ↓ 55.42%
  • 🕒 Wait Mean Time: ↓ 38.74%
  • ⚠️ Wait Max Time: ↑ 5.69%

rippled_ tree, cache, shamap - TaggedCache-3

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)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@vlntb vlntb marked this pull request as ready for review July 3, 2025 16:23
@vlntb vlntb requested a review from a team as a code owner July 3, 2025 16:23
Copy link
codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 16 lines in your changes missing coverage. Please review.

Project coverage is 79.0%. Comparing base (9874d47) to head (0a1963d).

Files with missing lines Patch % Lines
include/xrpl/basics/TaggedCache.ipp 77.8% 14 Missing ⚠️
src/xrpld/app/ledger/LedgerHistory.cpp 33.3% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5486     +/-   ##
=========================================
- Coverage     79.1%   79.0%   -0.1%     
=========================================
  Files          816     816             
  Lines        71622   71586     -36     
  Branches      8237    8261     +24     
=========================================
- Hits         56644   56572     -72     
- Misses       14978   15014     +36     
Files with missing lines Coverage Δ
include/xrpl/basics/SHAMapHash.h 93.5% <ø> (ø)
include/xrpl/basics/TaggedCache.h 100.0% <ø> (ø)
include/xrpl/basics/partitioned_unordered_map.h 98.8% <100.0%> (-0.3%) ⬇️
src/xrpld/app/ledger/LedgerHistory.h 40.0% <ø> (ø)
src/xrpld/app/ledger/LedgerHistory.cpp 50.7% <33.3%> (-1.4%) ⬇️
include/xrpl/basics/TaggedCache.ipp 84.6% <77.8%> (-1.0%) ⬇️

... and 6 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant
0