Prompt·Performance and scale·P04

Work repeated for nothing

Finds work redone on every request or screen redraw when nothing it depends on changed.

Markdown
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

More in Performance and scale.