performance-tuning

Profile Python code paths and validate optimizations with before/after benchmarks.

Updated Apr 24, 2026
One-click install
npx skills add https://github.com/SpencerGoss/agent-engineering --skill performance-tuning-spencergoss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-tuning
Source: https://github.com/SpencerGoss/agent-engineering/tree/main/performance-tuning
Command: npx skills add https://github.com/SpencerGoss/agent-engineering --skill performance-tuning-spencergoss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Performance-tuning provides a disciplined workflow to diagnose slow code paths, remove bottlenecks, and verify that optimizations deliver measurable improvements.

Core Features & Use Cases

  • Measure-first profiling with tools such as Python's cProfile, memory_profiler, and line_profiler to identify hot paths.
  • Apply deterministic optimization patterns (vectorization, hoisting invariant work, caching, chunking) and validate with before/after benchmarks.
  • Use Case: When a pipeline in a data processing job slows down after changes, you can isolate, optimize, and quantify improvements.

Quick Start

Profile a target Python script to identify bottlenecks, apply proven optimizations, and verify improvements with a before/after benchmark.

Frequently Asked Questions about performance-tuning

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

FAQPage Schema
How do I profile a Python script to find performance bottlenecks?

To profile a Python script and find performance bottlenecks, you measure hot paths first using tools like cProfile, memory_profiler, and line_profiler to identify slow code paths before applying any optimizations.

What is the best way to optimize slow code paths in a data processing pipeline?

The best way to optimize slow code paths is applying deterministic optimization patterns like vectorization, hoisting invariant work, caching, and chunking, then validating improvements with before/after benchmarks.

How do I benchmark Python code to verify optimization improvements?

To benchmark Python code and verify optimization improvements, you execute before/after benchmarks to quantify performance gains, ensuring that applied patterns deliver measurable and validated speed increases.

Can I use this performance tuning workflow for a data processing job that slowed down after changes?

Yes, you can use this performance tuning workflow for a data processing job that slowed down after changes to isolate bottlenecks, optimize the identified hot paths, and quantify the measurable improvements.

Why does my code optimization workflow need a measure-first approach?

A code optimization workflow needs a measure-first approach because it enforces the identification of actual bottlenecks through profiling before making changes, ensuring deterministic optimization steps and measurable performance verification.