optimize

Diagnose performance bottlenecks and apply behavior-preserving code optimizations.

6|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/wesleyosantos91/multi-agents --skill optimize-wesleyosantos91
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/wesleyosantos91/multi-agents/tree/main/devin/.devin/skills/optimize
Command: npx skills add https://github.com/wesleyosantos91/multi-agents --skill optimize-wesleyosantos91

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps identify why specific code is slow and applies the highest-impact optimizations without breaking existing behavior.

Core Features & Use Cases

  • Profiling conceitual: Detects performance hotspots such as nested loops, N+1 queries, unnecessary allocations, and blocking synchronous I/O.
  • Análise orientada por gargalo: Selects and performs a targeted deep dive using performance-reliability-reviewer when deeper throughput/latency/memory/concurrency analysis is needed.
  • Otimização com trade-off documentado: Applies the most impactful change with lower risk and explicitly records what was sacrificed (e.g., more memory for lower latency), then validates with tests and (when possible) simple before/after benchmarks.

Quick Start

Use the optimize skill to analyze and improve performance of the provided code file, ensuring tests pass and reporting the identified bottleneck, applied optimization, trade-off, and expected/measured results.

Frequently Asked Questions about optimize

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

FAQPage Schema
How do I identify performance bottlenecks and optimize slow code?

To identify performance bottlenecks and optimize slow code, you need profiling-driven hotspot detection to find issues like nested loops, N+1 queries, and unnecessary allocations, then apply targeted improvements that preserve existing behavior.

What is the best way to reduce latency and improve throughput in an existing codebase?

The best way to reduce latency and improve throughput is by applying risk-aware optimizations with documented trade-offs, such as sacrificing memory for lower latency, and validating the changes with tests and before/after benchmarks.

How can I optimize concurrency and memory inefficiency without breaking functionality?

You can optimize concurrency and memory inefficiency without breaking functionality by performing behavior-preserving validation with tests, ensuring that targeted improvements like blocking synchronous I/O removal maintain existing application behavior.

When do I need a deep performance and reliability review for code refactoring?

You need a deep performance and reliability review for code refactoring when profiling reveals complex throughput, latency, memory, or concurrency bottlenecks that require a targeted deep dive to safely apply high-impact optimizations.

Does code optimization always require measuring before and after performance?

Code optimization does not strictly require measuring before and after performance, but applying simple before/after benchmarks is highly recommended to validate expected results and confirm the targeted improvements yield safe gains.