You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recompiling a page has no speed budget in tests/perf #459
Nexy promises "Sub-100ms HMR" (AGENTS.md), and AGENTS.md also says a hot path gets a speed budget in tests/perf/. Recompiling a page after an edit is the Python half of every reload in nx dev, and it has no budget:
tests/perf/ holds test_startup_budget.py (a new process is ready in under a second) and test_request_budget.py (a request costs at most a few times bare Starlette);
the recompile time is only published (1.8 ms, docs/deployment/performance.md#startup-first-page-and-recompile), never enforced. A change that makes it 100 times slower passes every test.
Proposal
Add tests/perf/test_recompile_budget.py:
a project with one page that imports three components, like the README example;
compile the page once to warm up, then edit it and compile it again, 5 times, and keep the median (Compiler().compile(input=...) from nexy/modules/compiler);
the budget is 50 ms: thirty times the measured value, so a busy CI machine passes, and half of what the HMR promise leaves.
scripts/measure_speed.py measures the same step for the docs: read it first, and keep the two in the same terms.
Done when
python -m pytest tests/perf/test_recompile_budget.py passes on develop.
Slowing Compiler.compile down on purpose (add a time.sleep(0.1)) makes it fail.
Getting started
Copy the shape of tests/perf/test_startup_budget.py: a temporary project, a few runs, one assertion. Comment here before you start.
Je prends cette issue apres #696. Je commence par lire scripts/measure_speed.py et tests/perf/test_startup_budget.py, puis j'ajoute le test avec le budget de 50 ms.
Activity
Espoir-Loem commentedon Nov 28, 2026
Je prends cette issue apres #696. Je commence par lire scripts/measure_speed.py et tests/perf/test_startup_budget.py, puis j'ajoute le test avec le budget de 50 ms.
github-actions commentedon Nov 28, 2026
Implemented by #700 and merged as b26cbb8. Closing automatically.