ThinkWithPrompt by SynotticThinkWithPrompt

Speed up slow code

Finds performance bottlenecks and suggests faster approaches with measurable trade-offs.

Software DevelopmentRTFStandardCodingCodeFill-in Template

The prompt

Help me make this code faster. Language/runtime: [DETAILS] Code: [PASTE] What's slow and how I measured it: [timings, profiler output, data sizes] Constraints: [memory, readability, can't change interface] Deliver: 1. Likely bottlenecks, with the reasoning (complexity, I/O, allocations, N+1 queries, etc.). 2. Optimizations ranked by expected gain vs. effort, with code for the top ones. 3. How to benchmark before and after to confirm the gain. 4. Trade-offs introduced (readability, memory, correctness risks). Don't micro-optimize at the cost of clarity unless the gain is significant.

Highlighted [brackets] are blanks to replace with your own details.

Fill in the blanks and use this promptMore Software Development prompts

What to fill in

  • DETAILS
  • PASTE
  • timings, profiler output, data sizes
  • memory, readability, can't change interface

How this prompt is built

This prompt follows the RTF structure (Role, Task, Format). RTF tells the model who to be, what to do and what shape the answer should take. It is the quickest structure that still gives noticeably better results than a bare request.

Related prompts

Find more prompts like this