Skip to content

feat: warn on cold cache miss + per-item progress for touch metrics#59

Merged
stephenc222 merged 2 commits intomainfrom
feat/touch-cold-cache-ux
Apr 17, 2026
Merged

feat: warn on cold cache miss + per-item progress for touch metrics#59
stephenc222 merged 2 commits intomainfrom
feat/touch-cold-cache-ux

Conversation

@stephenc222
Copy link
Copy Markdown
Contributor

Closes #55

Summary

  • Cold-cache warning: when 50+ functions are missing from the touch cache, prints a note before phase 2 starts with the miss count and a rough time estimate. Users know why analysis is slow and that the second run will be fast.
  • Per-item progress during phase 2: progress callbacks now fire once per resolved miss as results drain from the channel (phase 3 loop), instead of jumping from (hits, total) directly to (total, total). The phase 3 drain is single-threaded so no Sync constraints.
  • --per-function-touches help text: documents the cache location, the cold/warm cost tradeoff, and the 50-miss warning threshold.
  • New test: test_populate_touch_metrics_progress_fires_per_miss — verifies phase 1 fires (0, 1) and phase 3 fires (1, 1) for a single-function cold-cache miss.

Test plan

  • 313/313 tests pass
  • hotspots analyze . --per-function-touches on a cold cache shows the note with count + estimate
  • Second run produces no note (warm cache)
  • Progress bar advances per function during phase 2 (not a single jump at the end)

🤖 Generated with Claude Code

@stephenc222 stephenc222 merged commit 91301df into main Apr 17, 2026
7 checks passed
@stephenc222 stephenc222 deleted the feat/touch-cold-cache-ux branch April 17, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux: improve first-run experience with --per-function-touches cold cache

1 participant