Skip to content

perf: per-run budgets for the background loops (#2019) - #2020

Merged
rubentalstra merged 3 commits into
mainfrom
perf/loop-budgets
Nov 26, 2026
Merged

rubentalstra merged 3 commits into
mainfrom
perf/loop-budgets

Conversation

@rubentalstra

@rubentalstra rubentalstra commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What changed and why

The hot-path budgets of #2003 hold the requests the gateway serves; this holds its background loops the same way (#1998's speed criterion).

  • app/ferrofed-server/tests/it/e2e/loop_budget.rs, in the e2e lane, runs one iteration of each loop five times after two warm runs, in the steady state its loop runs in: the store's sweep of expired rows (Store::sweep, over a real PostgreSQL 19), the registry reload of a registry document, as SIGHUP asks it (Reloader::reload), the PMIR subscription's check against a stub Patient Identity Registry (IdentityFeed::check, the subscription up) and the mCSD directory's refresh against a stub Care Services Directory (DirectoryRegistry::refresh, unchanged). The least allocations and the most store calls of each are held to BUDGETS.
  • The counting is the request budget's, now shared from e2e::budget (counting, warm, judge, StoreCalls::installed), so the two cases count the same way.
  • The book's performance gate page names the loop budgets.

The budgets come from the Linux CI figures of the e2e lane (job 140137806468): each allocation budget is the figure plus 2%, each store-call budget the figure itself.

Loop Allocations (budget) Store calls (budget)
Sweep 2 (2) 1 (1)
Reload 3045 (3106) 0 (0)
Pmir 110 (112) 0 (0)
Mcsd 546 (557) 0 (0)

No user-visible change, so no changelog fragment.

Closes #2019

Checklist

  • Spec-facing decisions cite the governing specification: no specification governs the cost of a loop: our own design.
  • The committed guards pass, the duplication ratchet included.
  • Rust gates pass.
  • No user-visible change: the pull request carries no-changelog.
  • Docs are updated: the book's performance gate page.
  • No patient data or real patient identifier in a fixture, test, or example.
  • Every commit is signed.
  • No AI or assistant attribution anywhere in the commits or this PR.

@rubentalstra rubentalstra added the no-changelog PR escape hatch: the change has no user-visible effect. label Nov 26, 2026
@rubentalstra
rubentalstra added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit c3efc40 Nov 26, 2026
43 checks passed
@rubentalstra
rubentalstra deleted the perf/loop-budgets branch November 26, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog PR escape hatch: the change has no user-visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quality pass: per-run budgets for the background loops

1 participant