Prompt·Performance and scale·P04
Work repeated for nothing
Finds work redone on every request or screen redraw when nothing it depends on changed.
Prompt
Identify expensive work that is repeated despite unchanged inputs. Investigate caching, memoization, batch operations, and incremental computation before recommending changes.
- What it returns
- The operation, how often it runs, how often its inputs change, and its measured cost.
- Skip it when
- Work that is already cheap, where saving results would add a risk of stale data for little gain.
- Changes
- Changes nothing
- Sessions
- One session
- Tools
- A profiler or request logs to count repeats.
- Watch for
- A cache is a second source of truth. Any cache proposal must say who invalidates it and when.
- Also called
- Repeated expensive work
Related prompts
- Two systems that disagreePromptFinds data kept in two places (a saved copy and a table, the browser and the server) that can quietly disagree.
- Slowest journeys, end to endPromptShows where the seconds go on the paths people actually use.
- Stop rewriting data that hasn't changedPromptUpserts and updates run at high volume, imports are costly, or vacuum and write-ahead log churn look high.
More in Performance and scale.