perf: gateway + DB + frontend optimizations (P8-003) #211
Reference in New Issue
Block a user
Delete Branch "feat/p8-003-performance"
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?
P8-003 — Performance Optimization
Summary
Measured and fixed concrete bottlenecks targeting <200ms TTFB and <2s page loads.
Changes
max=20,idle_timeout=30s,connect_timeout=5s— eliminates pool exhaustion and indefinite hangsINSERT … ON CONFLICT DO UPDATE— 50% fewer DB round-trips, no TOCTOU racesessions(user_id),accounts(provider_id, account_id), compoundconversations(user_id, archived), compoundagent_logs(session_id, tier)— auth hot-path now uses index scansORDER BY + LIMITtofindAll(200) andfindMessages(500) — prevents unbounded full scansonModuleInitfire-and-forget — removes 100–500ms from startup TTFBcompress,productionBrowserSourceMaps: false,image avif/webpformatsDocs
Full profiling report in
docs/PERFORMANCE.md.Quality gates
pnpm typecheck— 32/32 tasks passpnpm lint— 18/18 tasks passpnpm test— 125/125 tests passCloses #P8-003