Reduce API response time
Cut API p99 latency by parallelising synchronous operations, adding caching, fixing over-fetching, reducing serialization overhead, and eliminating N+1 queries.
Preview
Copy prompt
Our [Route] API endpoint has a p99 latency of [X ms] at [N] requests per second. Here is the handler: [Paste code]. Identify: sequential operations that could run in parallel, repeated queries that could be batched or cached, over-fetching from the DB, expensive serialisation in the hot path, and N+1 patterns from per-item data fetching. Show the optimised handler code with the changes annotated.
More
Performance
Prompts
