diff --git a/README.md b/README.md index 7a9f69617..d5b713edc 100644 --- a/README.md +++ b/README.md @@ -376,6 +376,17 @@ To run only the Angular app without Electron, use: $ pnpm run serve:frontend ``` +To see how many bytes the built web app puts on the initial load path (the +number CI ratchets), build it and run the measurement: + +``` +$ pnpm nx build web +$ pnpm run perf:initial-bytes +``` + +The contract behind that number is in +[docs/architecture/performance-journeys.md](docs/architecture/performance-journeys.md). + ## Disclaimer **IPTVnator doesn't provide any playlists or other digital content.** diff --git a/docs/architecture/performance-journeys.md b/docs/architecture/performance-journeys.md new file mode 100644 index 000000000..db374796e --- /dev/null +++ b/docs/architecture/performance-journeys.md @@ -0,0 +1,61 @@ +# Performance journeys and the CI ratchet + +IPTVnator measures performance through a small set of everyday user journeys. +Each journey has deterministic counters that are asserted exactly, and +wall-clock timings that are recorded as evidence. Counters are ratcheted in CI: +a committed baseline may only be lowered, and only with the measured output as +evidence. This document is the contract for that loop; `tools/performance/` +holds the scripts. + +## Journeys + +| Journey | Start | End | +| ---------------- | -------------------------------------------- | ----------------------------------------------------------------------------- | +| J1 `launch` | Electron process spawn | first playlist or portal card rendered on `/workspace`, inline splash removed | +| J2 `open-source` | click on a portal card | live category list and first channel page painted | +| J3 `playback` | click on a channel | HTML5 `playing` event | +| J4 `search` | six-character query typed into global search | results list settled | + +Only the J1 counter `renderer.initialBytes` is instrumented today. The other +journeys and counters follow the plan in `.plans/` and are added one thread at +a time; each thread names its journey and counter in the PR description. + +## `renderer.initialBytes` + +The bytes a browser fetches before Angular can bootstrap, read from the built +`dist/apps/web/index.html`: + +- `index.html` itself, +- every same-origin ` + +