Files
music_library/backlog/tasks/ml-169.2 - Phase-4-Performance-low-hanging-fruit-audit.md
T
2026-05-11 07:49:40 +01:00

2.1 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, references, parent_task_id, priority
id title status assignee created_date updated_date labels dependencies references parent_task_id priority
ML-169.2 Phase 4: Performance low-hanging fruit audit To Do
2026-05-08 08:59 2026-05-11 06:46
audit
ready
lib/music_library_web/live/stats_live/index.ex
lib/music_library_web/live_helpers/index_actions.ex
lib/music_library_web/live_helpers/record_actions.ex
.agents/skills/query-reporter/SKILL.md
ML-169 medium

Description

Identify unnecessary DB queries, redundant full-stream reloads, server round trips that could be client-side, missing optimistic UI opportunities, and blocking mount work that could be deferred.

Use QueryReporter skill to capture SQL traces for key page loads as evidence.

Key pre-flagged areas:

  • StatsLive.Index: 5 synchronous queries in mount (TTFB impact)
  • Display toggle (grid/list): full FTS query when CSS-only suffices
  • ScrobbleRulesLive + OnlineStoreTemplateLive: redundant stream_insert + immediate full reload
  • ScrobbledTracksLive + StatsLive: full stream reset on every scrobble batch instead of incremental insert
  • Search inputs: verify phx-debounce is set

Acceptance Criteria

  • #1 SQL traces captured via QueryReporter for /collection, /collection/:id, /stats, /artists/:id
  • #2 Stream reset audit complete: every stream(:name, data, reset: true) call site evaluated for incremental-update alternatives
  • #3 Display toggle (grid/list) evaluated: confirmed whether CSS-only toggle can replace full DB reload
  • #4 StatsLive.Index mount blocking work quantified: 5 queries identified, assign_async feasibility assessed
  • #5 Search input debounce verified: phx-debounce attribute presence checked on all search forms
  • #6 Optimistic UI opportunities identified for delete, form save, toggle operations
  • #7 N+1 audit complete: handle_params, stream rendering, and LiveComponent Repo calls checked
  • #8 Findings report written as a Backlog.md document with file:line references, severity ratings, and fix recommendations