Skip to content

Destroy parallel apply state asynchronously. - #5414

Open
dmkozh wants to merge 1 commit into
stellar:masterfrom
dmkozh:async_par_apply_cleanup
Open

Destroy parallel apply state asynchronously.#5414
dmkozh wants to merge 1 commit into
stellar:masterfrom
dmkozh:async_par_apply_cleanup

Conversation

@dmkozh

@dmkozh dmkozh commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Destroy parallel apply state asynchronously.

The state data structures are rather large and nested (due to containing XDR), so when they get large de-allocation may take up to a few ms. We don't really need to block the apply thread on this de-allocation, so we can hide it in the background thread.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

The state data structures are rather large and nested (due to containing XDR), so when they get large de-allocation may take up to a few ms. We don't really need to block the apply thread on this de-allocation, so we can hide it in the background thread.
@dmkozh
dmkozh force-pushed the async_par_apply_cleanup branch from 83388a4 to dd62ae8 Compare August 14, 2026 20:12
@dmkozh
dmkozh marked this pull request as ready for review August 14, 2026 20:15
Copilot AI balanced review requested due to automatic review settings August 14, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Defers destruction of large parallel Soroban apply-state structures to background workers.

Changes:

  • Asynchronously destroys per-thread apply states.
  • Heap-allocates and asynchronously destroys global apply state.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ledger/LedgerManagerImpl.cpp
@dmkozh
dmkozh requested a review from graydon August 14, 2026 20:49
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.

2 participants