audio streaming app plyr.fm
38
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: status update for GET /tracks/top optimization (#879) (#880)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

authored by

nate nowack
Claude Opus 4.6
and committed by
GitHub
74fffdd3 d11e10f3

+17 -2
+16 -1
STATUS.md
··· 47 47 48 48 ### February 2026 49 49 50 + #### optimize GET /tracks/top latency (PR #879, Feb 8) 51 + 52 + **baseline (production, 171 requests over 3 days)**: p50=123ms, p95=1204ms, p99=1576ms. the p95/p99 spikes were caused by stale connection reconnects during `pool_pre_ping` and redundant DB round-trips. 53 + 54 + **optimizations**: 55 + - **merged query**: new `get_top_tracks_with_counts()` returns (track_id, like_count) tuples in a single GROUP BY — the count was already computed to sort, now it's returned instead of discarded. eliminates a redundant `get_like_counts` call (1 fewer DB round-trip) 56 + - **scoped liked query**: the authenticated user's liked-track check now filters by `track_id IN (...)` (10 rows) instead of scanning all user likes 57 + - **pool_recycle 7200s → 1800s**: connections recycle every 30min instead of 2h, reducing stale connections that trigger expensive reconnects 58 + 59 + **verified via Logfire traces**: authenticated requests dropped from 11 DB queries to 7. post-deploy requests at 517-600ms vs baseline p95 of 1.2s. 60 + 61 + **14 new regression tests** covering ordering, limit clamping, auth state, like counts, comment counts, and tags. 62 + 63 + --- 64 + 50 65 #### auto-tag at upload + ML audit script (PRs #871-872, Feb 7) 51 66 52 67 **auto-tag on upload (PR #871)**: checkbox on the upload form ("auto-tag with recommended genres") that automatically applies genre tags after classification completes. user doesn't need to come back to the portal to apply suggested tags. ··· 593 608 594 609 --- 595 610 596 - this is a living document. last updated 2026-02-07. 611 + this is a living document. last updated 2026-02-08.
+1 -1
loq.toml
··· 19 19 # STATUS.md grows over time as we document work 20 20 [[rules]] 21 21 path = "STATUS.md" 22 - max_lines = 600 22 + max_lines = 612 23 23 24 24 [[rules]] 25 25 path = "backend/src/backend/_internal/auth.py"