Skip to content

perf(replay): prune SlotTracker elements off main thread#1229

Open
kprotty wants to merge 2 commits intomainfrom
king/prune-tracker-async
Open

perf(replay): prune SlotTracker elements off main thread#1229
kprotty wants to merge 2 commits intomainfrom
king/prune-tracker-async

Conversation

@kprotty
Copy link
Contributor

@kprotty kprotty commented Feb 12, 2026

The pruneNonRooted function frees Elements in the SlotTracker older than rooted slot. After a fork converges in replay, this ends up taking hundreds of millis (sometimes 1s+). Moving the element frees off the replay thread brings it down to a few hundred micros.

An alternative implementation is to have a dedicated std.Thread in the SlotTracker itself. Avoids the edits of having to pass down the ThreadPool. But I think it pool will come in handy for other rooting stuff (e.g. run onSlotRooted asynchronously).

@kprotty kprotty self-assigned this Feb 12, 2026
@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig Feb 12, 2026
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 93.44262% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/replay/service.zig 0.00% 2 Missing ⚠️
src/replay/consensus/process_result.zig 50.00% 1 Missing ⚠️
src/replay/trackers.zig 98.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/replay/consensus/core.zig 94.97% <100.00%> (-0.01%) ⬇️
src/replay/consensus/process_result.zig 93.04% <50.00%> (-0.31%) ⬇️
src/replay/trackers.zig 99.27% <98.00%> (-0.33%) ⬇️
src/replay/service.zig 93.44% <0.00%> (-0.19%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kprotty kprotty marked this pull request as ready for review February 13, 2026 22:23
@kprotty kprotty requested review from dnut, ultd and yewman as code owners February 13, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

1 participant