Prompt·Performance and scale·P06
Loops that blow up with big data
Finds loops inside loops that are fine at 50 rows and painful at 50,000.
Prompt
Identify potentially quadratic or worse operations in frequently used code paths, including nested joins in application memory, copy-on-every-iteration patterns and repeated scans. Determine realistic input sizes and benchmark the highest-impact candidates before changing their algorithms.
- What it returns
- Each candidate with realistic input size and a benchmark at that size; ignore candidates whose real inputs stay small.
- Skip it when
- Code whose inputs are small and capped by design.
- Changes
- Changes nothing
- Sessions
- One session
- Tools
- A speed-test setup. The experimental agent-complexity-optimizer scanner can suggest places to look.
- Watch for
- Static scanners flag nested loops over tiny arrays. Without real sizes the list is mostly noise.
- Also called
- Growth complexity analysis
Related prompts
More in Performance and scale.