Skip to content

perf(app): keep a busy tracker's boards current for less CPU and memory - #299

Merged
GraemeF merged 11 commits into
mainfrom
bdi-cro9
Oct 9, 2026
Merged

GraemeF merged 11 commits into
mainfrom
bdi-cro9

Conversation

@GraemeF

@GraemeF GraemeF commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

On a busy tracker the watcher drew every project's trees on every collection and told each board about every project, even when the probe had found nothing new. Now a collection draws nothing when no read finds its tracker has moved. It only vouches that each project it read is as current as the read. A collection that does draw tells the watcher only of projects that were read again, or whose beads' readiness changed because a blocker in another project moved.

The watcher's threads now allocate from one malloc arena. Its live heap was the same before and after the read change, but each thread's arena kept what that thread freed, so resident memory sat at about twice the live heap. The arena setting has no unit test, because its effect shows only in a measurement.

Measured on the reproduced workload in bench/boards: the watcher plus five boards, a 90 s warm-up and a 300 s window, with runs interleaved main, branch, main, branch.

main this branch
Watcher CPU time 45 to 47 s 20 to 22 s
Watcher peak resident 423 to 454 MB 289 to 304 MB
Boards' CPU time 102 to 120 s 68 to 74 s

The boards stay as current as before. They saw the same writes, with a median delay of about 1.5 to 2 s on both sides and a longest delay under 3 s. The longest time a board's freshness answer went stale fell from 14 to 22 s to under 3 s. CPU time spent in bd under the watcher is unchanged, because the watcher asks bd the same things.

@GraemeF
GraemeF merged commit 53497ec into main Oct 9, 2026
2 checks passed
@GraemeF
GraemeF deleted the bdi-cro9 branch October 9, 2026 07:15
GraemeF added a commit that referenced this pull request Oct 9, 2026
The watcher change in #299 landed after the notes were written. The
board highlight now gives the effect of both performance changes
together, from the board benchmark's figures.
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