Performanceprompt onlyIntermediate

Slow Endpoint Hunter

This loop identifies and optimizes slow API endpoints by continuously benchmarking, analyzing performance bottlenecks, and applying targeted improvements until response times meet predefined budgets.

← all loops
apiperformanceoptimizationbenchmarkinglatency

Goal

Optimize slow endpoints

How to Run

Run this loop in your preferred coding agent environment to systematically optimize slow endpoints through automated performance analysis and iterative improvements.

  1. 01

    Install Dependencies

    Ensure you have necessary tools installed (e.g., Postman, curl, or custom benchmarking scripts) for measuring endpoint performance.

  2. 02

    Configure Benchmark Thresholds

    Set clear response time budgets per endpoint in your configuration or environment variables.

  3. 03

    Initiate Loop

    Execute the kickoff prompt in your coding agent. The agent will handle the rest, iterating up to 10 times or until optimization goals are met.

Workflow Steps

  1. 01

    Run 'endpoint benchmark' to measure current endpoint response times against defined budgets

  2. 02

    Identify slowest endpoints exceeding thresholds

  3. 03

    Analyze root cause (database queries, inefficient algorithms, external service latency, etc.)

  4. 04

    Implement targeted optimization for one identified endpoint

  5. 05

    Re-run benchmark to validate improvement

  6. 06

    If endpoints still exceed budget and iterations remain, repeat process; else exit successfully

Kickoff Prompt

Start the "Slow Endpoint Hunter" loop.

Goal: Optimize slow endpoints
Max iterations: 10
Between iterations run: endpoint benchmark
Exit when: Endpoints within budget


Analyze our application's API endpoints for performance bottlenecks. Begin by running the 'endpoint benchmark' command to measure response times. Identify any endpoints exceeding their performance budgets and prioritize optimizing them. For each iteration, select the slowest endpoint, diagnose its bottleneck, apply a targeted fix, then re-benchmark to confirm improvement. Continue this cycle until all endpoints are within budget or we reach 10 iterations. Document each optimization applied.

Self-pace this loop. After each iteration, run `endpoint benchmark` and evaluate the output, and only continue if the exit condition is not met (Endpoints within budget). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Always backup code before making changes
  • ·Do not modify more than one endpoint per iteration cycle
  • ·Avoid database schema changes without explicit approval
  • ·Log all performance changes for auditability

Flow Diagram

rendering…

Related loops — Performance