← IndexEntry № 100·coding

Optimize a Slow Function With Specific Tradeoffs

Get a ranked list of optimizations with complexity analysis and explicit tradeoffs.

Optimized for
ClaudeChatGPT
§ The Prompt— ready to copy
optimize-slow-function.prompt
This function is too slow at [INPUT SIZE]. Code:

[PASTE CODE]

Analyze: (1) current time and space complexity, (2) the bottleneck operation, (3) 2-3 optimization approaches ranked by impact, (4) for each, the new complexity and what you're trading off (memory, code clarity, edge case handling), (5) which I should pick given my constraint: [LATENCY/MEMORY/READABILITY].

Replace anything in [BRACKETS] with your specifics before sending.

Best For — Roles
Use For — Tasks
Tags#performance#optimization#coding
§ Related Entries

You may also need