code-optimizer

Profile code performance, identify bottlenecks, and apply targeted optimizations.

1|2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill code-optimizer-santosomar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-optimizer
Source: https://github.com/santosomar/general-secure-coding-agent-skills/tree/main/skills/code-quality/code-optimizer
Command: npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill code-optimizer-santosomar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses code that is too slow by systematically identifying performance bottlenecks and applying targeted optimizations.

Core Features & Use Cases

  • Performance Profiling: Identifies CPU or I/O bound operations using appropriate profiling tools.
  • Bottleneck Analysis: Pinpoints the exact functions or code sections consuming the most resources.
  • Optimization Strategy: Recommends and applies the most effective optimization techniques, from algorithmic changes to micro-optimizations.
  • Measurement & Verification: Ensures optimizations yield measurable improvements without regressions.
  • Use Case: When a critical API endpoint is experiencing high latency, this Skill can profile the request, identify the slow database query or inefficient loop, and refactor it for significant speedup.

Quick Start

Use the code optimizer skill to profile the performance of the process_data function in main.py and suggest optimizations.

Frequently Asked Questions about code-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify and fix slow code on a critical API endpoint?

To fix slow code on a critical API endpoint, you need to profile the request to pinpoint the slow database query or inefficient loop, then apply targeted optimizations like algorithmic changes or caching to achieve significant speedup.

What's the best way to profile CPU or I/O bound operations for performance optimization?

The best way to profile CPU or I/O bound operations is using appropriate profiling tools to pinpoint the exact functions consuming the most resources, enabling targeted improvements like batching or caching on slow hot paths.

How do I ensure my code optimizations actually improve speed without causing regressions?

Ensuring code optimizations improve speed without regressions requires measurement before and after each change to verify impact and ensure correctness, confirming that targeted improvements like algorithmic changes yield measurable improvements.

When should I apply caching or batching to optimize slow operations on hot paths?

You should apply caching or batching to optimize slow operations on hot paths after profiling identifies the specific bottlenecks, ensuring these targeted improvements address the exact resource-consuming functions directly.

Can I use this approach to refactor inefficient loops and slow database queries?

Yes, you can use this optimization approach to refactor inefficient loops and slow database queries by profiling the request, identifying the bottleneck, and applying targeted optimizations for significant speedup.