Loop Optimizer

Optimize loop-heavy code with this AI prompt, leveraging Jon Bentley's methodologies for efficient algorithmic transformations.

What this prompt does

  • Analyzes loop-heavy code to identify inefficiencies and optimize performance using systematic techniques.
  • Applies Jon Bentley's principles to improve algorithmic complexity and data access patterns.
  • Provides concrete code transformations with before/after comparisons and performance estimates.

How to use this prompt

  1. Fill in the [INSERT YOUR LOOP-HEAVY CODE], [INSERT INFORMATION ABOUT DATA VOLUMES AND RANGES], [INSERT SPECIFIC PERFORMANCE TARGETS OR CONSTRAINTS], [INSERT KNOWN PERFORMANCE ISSUES OR SLOW SECTIONS], and [INSERT PROGRAMMING LANGUAGE AND PLATFORM DETAILS] placeholders with your specific code, dat…
  2. Example: "My code containing loops is a nested for-loop iterating over a large matrix. My typical data sizes involve matrices with dimensions up to 1000x1000. My performance requirements include reducing execution time by at least 20%. My current bottlenecks are in the matrix multiplication secti…

Free prompt — copy, paste and run. Part of the Coding prompts collection in the God of Prompt library.

Related Coding prompts