From 10d016f9d7812738db2d47a30ee1ffc4cf6653b5 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Sun, 29 Mar 2026 16:04:31 -0400 Subject: [PATCH] perf: add LB popularity vs cross-ref breakdown to slow path logging --- backend/explore/explore.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/explore/explore.go b/backend/explore/explore.go index 5aae036..dc74276 100644 --- a/backend/explore/explore.go +++ b/backend/explore/explore.go @@ -424,10 +424,20 @@ func (e *Service) Search(query string) (*MBSearchResult, error) { e.boostWithIndexPopularity(&result) } else { // Phase 2: LB popularity lookups (3 POST calls, rate-limited). + lbStart := time.Now() e.boostWithPopularity(&result) + lbDur := time.Since(lbStart) // Phase 3: cross-reference artist discographies. + xrefStart := time.Now() e.crossReferenceAlbums(query, &result) + xrefDur := time.Since(xrefStart) + + e.logger.Info("search slow path breakdown", + "query", query, + "lbPopularity", lbDur.Round(time.Millisecond), + "crossRef", xrefDur.Round(time.Millisecond), + ) } p2Dur := time.Since(p2Start)