perf(statistics): deck routes take 2–30 s on real data (P1) #157
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#157
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Priority: P1. The statistics deck is too slow to present from on real data.
Evidence
Master @
92fe600, run locally on a copy of the prod DB (236 MB, data from 2026-09-03 to 2026-09-26), with HikCentral calls blocked. Browser sweep as operator; single-route timings fromcurl:GET /periods/week/2026-09-14/summaryGET /timeseries/daily?start=2026-09-14&end=2026-09-20GET /timeseries/daily?…&bucket=hour(week heatmap)GET /timeseries/daily(previous week)GET /dwell/dayparts?day=…&baseline=usual_weekdayGET /periods/day/…/summaryGET /periods?granularity=day&limit=100Time until a view stops showing LOADING in the browser:
The view's parallel requests look serialised on the server, so a Room view costs roughly the sum of its routes. On top of that, every profile switch re-renders and refetches (Day and Month keep no route cache). A presenter switching Room/Desk/Laptop or stepping periods waits several seconds each time.
Open questions (needs triage)
Related: #156 (view consolidation; a shared per-period cache fits there).
Maintainer triage — 2026-09-27
Highest-priority implementation work. Profile against the existing production-copy reproduction before selecting optimizations; retain the target of every closed-period view interactive within 1 second. Record route and browser timings before/after, including first load and profile switching. Closed periods are not immutable: any cache must invalidate for verdict edits, applicable schedule changes, backfills and late ingestion. Coordinate with #156 without requiring its entire scope first.
gabogg referenced this issue2026-09-27 23:39:54 +00:00