Skip to main content

Performance

How the Suite's speed is measured, what the baseline is, and how to tell a regression from noise (#76). Every number here comes from a repeatable run, never from impressions.

The run​

scripts/perf/measure.mjs drives Chromium (Playwright) against a local production build and reads its own counters: CDP Performance and HeapProfiler in the browser, Navigation and Resource Timing for the network, ps for the server process, and a probe of /api/health every 500 ms as the server's responsiveness while everything else runs.

ScenarioWhat it shows
pagesFirst load of drones, drone detail, its flight logs tab, customers, customer detail, licences and Drone Control: timings, heap, DOM nodes, requests and API latency
repeatThe same tab cycling through every page: heap, nodes and listeners after garbage collection, to catch accumulation
dwellDrone Control left open for a minute: requests per minute, heap and listeners before and after
hiddenThe same page reported hidden, as a background tab: what keeps running
offline20 s without network, then back: attempts while offline and time to the first answer after
tabsThree Drone Control tabs at once: what the server receives

Running it​

  1. Build for production with the local flags: NEXT_PUBLIC_ENV=test NEXT_PUBLIC_SITE_URL=http://localhost:3100 NEXT_PUBLIC_DRONE_CONTROL_LTE_ENABLED=true NEXT_PUBLIC_DRONE_VIDEO_MEDIAMTX_ENABLED=true npx next build, then copy .next/static and public into .next/standalone, as scripts/node/build.mjs does.
  2. Optionally make a larger copy of the local database: node scripts/perf/seed-volume.mjs .local/suite-test.db .local/suite-perf.db 20. It clones the existing rows with fresh ids; it refuses to write over its source.
  3. Start node .next/standalone/server.js with PORT=3100, NODE_ENV=production, SUITE_DATABASE_PATH pointing at the database and a throwaway AUTH_SESSION_SECRET.
  4. Run node scripts/perf/measure.mjs --base http://localhost:3100 --pid <server pid> --db <the database> --secret <that secret> --out run.json.

A production build refuses the local test sign-in by design, so the run mints the local test administrator's session cookie itself with the secret the local server was started with. Never point it at a deployed Suite.

Baseline, 9 November 2026​

MacBook Pro (Darwin arm64), Chromium 141 headless, 1440×900, production build of develop at af69386, local SQLite. Production at the time held 2 customers, 5 drones, 197 flight logs and 108 media, on a 2-vCPU, 1 GB server.

DataCustomersDronesFlight logsDocumentsMedia
Current (test database, production order of magnitude)49295029
Growth (×20 copy)441094,0291,0502,029

Pages, first load​

PageLCP current / growthMain-thread tasks (ms)DOM nodesJS heap (MB)Slowest API
Drones68 / 80 ms61 / 92869 / 4,8555.8 / 6.58 ms
Drone detail76 / 68 ms70 / 77630 / 8336.3 / 6.24 ms
Drone flight logs tab80 / 64 ms138 / 1521,961 / 2,3809.2 / 8.54 ms
Customers64 / 60 ms57 / 67490 / 1,9305.6 / 5.74 ms
Customer detail68 / 68 ms63 / 67437 / 7055.6 / 5.85 ms
Licences68 / 64 ms67 / 72543 / 1,2185.5 / 6.24 ms
Drone Control576 / 672 ms122 / 144691 / 6916.8 / 7.219 ms (fleet)

Pages are rendered on the server; the browser makes two or three API calls per page. Drone Control is the heaviest load (about 400 KB, 185 KB of it scripts), and its LCP is the satellite map.

Over time​

  • No accumulation in the browser. Five rounds through every page in one tab end at the same heap (5.8 MB), nodes (324) and listeners (584) after GC, on both data sets. A minute on Drone Control leaves nodes and listeners unchanged and the heap within 0.1 MB.
  • Server memory is not yet flat. The Node process grows from about 110 MB to 210 MB during the first run (caches and JIT warming), then by 2–5 MB per run: 223, 224, 226 and 230 MB at the end of four more runs, 236 MB a moment after. That is too short to tell a slow leak from a heap V8 has not collected yet. /api/health answers in 3–4 ms (p95) throughout, never failing.
  • Drone Control polling. One batched POST /api/drones/gateway-tokens per tab, on connect and about every minute; with no gateway reachable (local runs) the links' reconnect attempts bring it to 4–5 a minute. Three tabs make three times the requests: about 10–12 a minute in all.
  • Network loss. About seven attempts during 20 s offline; the first API answer arrives about 60 ms after the network returns.

Findings​

Nothing measured in the browser needs fixing at today's volume or at twenty times it: no API takes more than 20 ms, no page more than 152 ms of main-thread work, and nothing grows in the browser over time. Residual items, with their measured cost:

  • Server memory creeps by 2–5 MB per run after warm-up (above). On the 1 GB production server that is not urgent, but it needs a longer soak with heap snapshots before it can be called a leak or ruled out.

  • A hidden Drone Control tab keeps its links working (2–4 requests a minute in local runs). Pausing them is not done: the Drone Control telemetry and alarms are meant to keep running in the background, so it is a product decision, not a performance fix.

  • The drones list renders every row: about 45 DOM nodes per drone, 4,855 at 109 drones, still 92 ms of main-thread work. Worth paginating if fleets reach several hundred drones.

  • The flight logs tab is the busiest page (138–152 ms of tasks), mostly the table and its summary; it does not grow with the number of logs at this scale.

  • Drone Control's LCP (0.6–0.7 s) is the external satellite tiles, not the Suite.

  • Cancelled Next.js prefetch requests show as "failed" in the run: harmless.

Catching a regression​

Rerun on the same machine and data and compare with the tables above. Treat as a regression, worth a look before merging:

  • any page's main-thread tasks or LCP up by more than 50 %, or the LCP of a page other than Drone Control above 500 ms;
  • any API above 50 ms median;
  • heap, nodes or listeners rising from one repeat round to the next, or after the dwell;
  • Drone Control above 10 requests a minute in one tab, or a hidden tab doing more than a visible one;
  • server memory rising faster than the 2–5 MB per run measured here, or /api/health p95 above 20 ms.

Not yet covered: a mobile CPU profile, real network conditions (with #53 for video), and the server under several concurrent users.