Skip to content
PromptLab by FEHMER TECH
ENDE
Coding

Performance Profiling and Optimization

Identify performance bottlenecks and get concrete optimization strategies.

Prompt template

Analyze the following [PROGRAMMING LANGUAGE] code for performance issues and create an optimization plan.

**Current Situation:**
- Measured execution time: [TIME]
- Desired execution time: [TARGET TIME]
- Input size: [DATA SIZE]
- Environment: [HARDWARE/CLOUD INSTANCE]

**Please analyze:**
1. **Hotspot Analysis:** Which code sections consume the most time?
2. **Memory Analysis:** Are there memory leaks or excessive memory usage?
3. **I/O Analysis:** Are I/O operations handled efficiently?
4. **Parallelization:** Can parts of the code be parallelized?
5. **Caching:** Where could caching strategies help?
6. **Data Structures:** Are the chosen data structures optimal?

**For each issue, provide:**
- Description of the bottleneck
- Optimized code with explanation
- Expected performance improvement
- Measurable metrics for validation

Code:
```[PROGRAMMING LANGUAGE]
[INSERT CODE HERE]
```

Replace placeholders in [square brackets]: [PROGRAMMING LANGUAGE][TIME][TARGET TIME][DATA SIZE][HARDWARE/CLOUD INSTANCE][INSERT CODE HERE]

How to use this template

Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.

Tips for better results

  • Share current benchmark numbers for a realistic assessment
  • Specify the hardware and deployment scenario
  • Ask for profiling tools specific to your language
  • Request prioritization of optimizations by effort/benefit ratio

Suitable open models

The selection names current open models as a starting point for your own tests. It is not a measurement for this template.

Keywords: #performance #profiling #optimization #benchmarking

Last updated: