Skip to content

fix: performance improvements#62

Merged
AdamJ merged 2 commits intomainfrom
claude/performance-improvements-aoIS5
Mar 22, 2026
Merged

fix: performance improvements#62
AdamJ merged 2 commits intomainfrom
claude/performance-improvements-aoIS5

Conversation

@AdamJ
Copy link
Owner

@AdamJ AdamJ commented Mar 22, 2026

  • update archive page summary stats
  • update archive item row rendering

claude added 2 commits March 22, 2026 15:33
Archive.tsx:
- Import calculation utilities directly at module scope (stable refs) instead
  of pulling unstable context method wrappers
- Wrap all four summary-stat reduce() calls (totalHoursWorked, totalBillable,
  totalNonBillable, totalRevenue) in a single useMemo keyed on
  [filteredDays, projects, categories]; previously they ran unconditionally on
  every render even when nothing had changed

ArchiveItem.tsx:
- Add dayStats useMemo ([day, projects, categories]) computing per-day hours
  and revenue once per item instead of calling context getters inline, which
  also eliminates the double getRevenueForDay() call in the revenue badge
- Add projectMap / categoryMap useMemo lookups so the task-table row loop
  uses O(1) Map.get() instead of O(n) Array.find() per row
- Convert the daily-summary IIFE into a useMemo([day.tasks]) so
  generateDailySummary() only runs when task descriptions actually change

https://claude.ai/code/session_012AmNjF3Ju9VJwSWybJqBEw
@AdamJ AdamJ self-assigned this Mar 22, 2026
@AdamJ AdamJ added the enhancement New feature or request label Mar 22, 2026
@AdamJ AdamJ merged commit b90ec9a into main Mar 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants