aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit c24e29258d97d457465f8ec4560c9d14509bee5d
parent 673cc6d2a9a4e321477236ca86420cf2bca9f6b5
Author: anon <anon@example.com>
Date:   Thu,  5 Nov 2026 04:35:06 +0000

Base test performance work on measured costs instead of a fixed target

Diffstat:
MTODO.md | 26++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -136,20 +136,26 @@ rewriting this document does not close them. asset tree; the tagged executable runs without external assets; representative resource reads and HTTP responses agree in both modes. Update build/release instructions and resource tests to cover both providers. -- [ ] **Make `cd server && go test .` a lightweight development check.** +- [ ] **Measure server test costs and remove obvious inefficiencies.** + The reported full run takes tens of minutes, but `-v` shows progress; quiet + output alone does not establish a hang. Establish a baseline before setting + a runtime target or changing which tests run by default. Measure compile/link time and binary size, package initialization, and test execution separately before attributing the delay to embedding alone. `gamedata` also embeds about 145 MB of definitions and eagerly loads/validates catalogs in `init`; default fixtures call production server initialization. - Remove unnecessary full-world/catalog setup from focused tests and keep - genuinely expensive world/catalog/integration checks in an explicit suite, - preserving their assertions and a documented command to run them. Browser - scenarios remain opt-in through the separate end-to-end suite. Do not achieve - speed by silently dropping coverage or merely requiring `-short` for normal use. - Completion: on the documented development machine, a warm-build-cache run of - `go test -count=1 .` completes within 30 seconds without browsers or the bundled - asset tree; record cold-build timing separately and verify a focused test does - not pay for unrelated world initialization. Explain standard Go output behavior: + Use per-test timings and focused profiling to identify dominant costs, such as + repeated full-world/catalog setup, redundant database work or unnecessary + waits. Fix measured waste with small changes while preserving assertions, + fixture isolation and default coverage. Consider a separate expensive suite + only if the measurements justify that tradeoff; do not move tests merely to + meet an arbitrary time budget. Browser scenarios remain opt-in. + Completion: record the baseline, dominant costs, focused fixes and comparable + before/after timings on the same machine with the same test selection and + cache conditions. Use `-count=1` to avoid cached test results and report cold + builds separately. If no straightforward improvement is found, record that + result and any justified follow-up rather than forcing a broad rewrite. + Explain standard Go output behavior: plain `go test .` reports passing package results at completion; `-v` enables per-test output once compilation and package initialization finish. - [ ] **Separate browser scenarios from Go internals through a test-only API.**