optimize

Profile code to identify and resolve performance bottlenecks like lock contention.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/g-zenr/relay-api --skill optimize-g-zenr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/g-zenr/relay-api/tree/main/.claude/skills/optimize
Command: npx skills add https://github.com/g-zenr/relay-api --skill optimize-g-zenr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers identify and fix performance bottlenecks in their code, ensuring applications run efficiently and smoothly.

Core Features & Use Cases

  • Performance Profiling: Analyzes code to pinpoint areas of slow execution, high memory usage, or lock contention.
  • Targeted Optimization: Provides a structured approach to implementing and verifying performance improvements.
  • Use Case: A web service is experiencing slow response times under load. This Skill can be used to profile the service, identify the slowest endpoints or functions, and guide the developer in optimizing them.

Quick Start

Use the optimize skill to profile and improve the performance of the main API endpoint.

Frequently Asked Questions about optimize

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

FAQPage Schema
How do I identify and resolve performance bottlenecks like lock contention in my code?

To resolve performance bottlenecks, you profile the code using a structured methodology of baseline measurement, profiling, and targeted fixes to pinpoint lock contention, external resource blocking, and middleware overhead.

What is the best way to profile code for slow execution and high memory usage?

Profiling code for slow execution and high memory usage requires measuring a baseline first, then analyzing the application to pinpoint specific bottlenecks, implementing targeted fixes, and verifying the performance improvements after changes.

How do I optimize a web service experiencing slow response times under load?

Optimizing a web service under load involves profiling the service to identify the slowest endpoints, applying targeted fixes to resolve bottlenecks, and verifying that response times improve while maintaining code readability and thread safety.

What principles should I follow when doing code optimization and benchmarking?

Code optimization and benchmarking principles require measuring performance before and after changes, focusing strictly on identified bottlenecks, and ensuring that all targeted fixes maintain code readability and thread safety throughout the process.

Does code profiling work without setting up a baseline measurement first?

Code profiling requires a baseline measurement first to establish a performance reference point. You must measure before and after applying targeted fixes to accurately verify that the optimization has resolved the bottlenecks.