Files
computer-playbook/tests
kevinveenbirkenbachandClaude Opus 5 dc772d6dc7 perf(applications): memoise the payload a render re-enters for
get_merged_applications writes its cache in the last line of the function,
and the re-entrancy guard returns above it. Every lookup('applications') a
template makes while the payload is being rendered therefore rebuilt it:
get_application_defaults deep-copies roughly two hundred roles, then the
merge runs again.

Profiled over one render of tests/integration/roles/test-e2e-cli: 382 calls,
18.765s of 29s, 13.7 million deepcopy calls. That test spent 208s in setUp
for twenty renders and now spends about half.

The guarded payload cannot go into _MERGED_APPLICATIONS_CACHE, because it
carries no users and still holds its volumes. It is memoised on the render
guard instead, which is thread-local, and the finally that releases the guard
drops it, so it lives exactly one render.

Three probes established the preconditions before the change: one cache key
across all 381 nested calls, re-entrancy depth never above 2, and not one of
the 381 payloads mutated after it was handed out. That last one was then
re-measured across the whole suite with the memo made self-checking: 6861
tests and 5133 subtests, no caller wrote to what it was given.

113113e553 removed the same cost between tasks through the carrier fact.
This removes what remains inside a single render.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-26 00:52:32 +02:00
..
…

Tests 🧪

All automated tests for Infinito.Nexus live here.

Directory Type Guide
unit/ Unit tests (isolated, no I/O) unit.md
integration/ Integration tests (real component boundaries) integration.md
external/ Opt-in live third-party checks, excluded from make test external.md
e2e/ End-to-end Playwright tests playwright.md
regression/ Regression guard rules regression.md
lint/ Structural lint checks lint.md

Run each suite via the make targets documented in the linked guides.