perf-profiling

Profile Python applications for CPU, memory, and async bottlenecks.

1|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/CybLow/pypaginate --skill perf-profiling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perf-profiling
Source: https://github.com/CybLow/pypaginate/tree/main/.opencode/skills/perf-profiling
Command: npx skills add https://github.com/CybLow/pypaginate --skill perf-profiling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Profile Python applications to identify performance bottlenecks and inefficiencies across CPU and memory workloads.

Core Features & Use Cases

  • CPU profiling with py-spy and Scalene to locate hotspots
  • Memory profiling with memray to track allocations and leaks
  • Line-by-line profiling with line_profiler for granular timing
  • Async profiling with yappi to measure concurrent code paths
  • Flame graphs, reports, and quick-start usage for rapid triage
  • Guidance for integrating with common workflows and debugging sessions

Quick Start

Run a profiler on your Python script to generate a profile and inspect the results.

Frequently Asked Questions about perf-profiling

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

FAQPage Schema
How do I profile Python application performance bottlenecks?

Profile Python applications to identify performance bottlenecks using multiple profiling backends. The toolkit detects CPU hotspots, memory leaks, and inefficient code paths to pinpoint exactly where execution time and resources are consumed.

What is the best way to track memory leaks in a Python script?

Tracking memory leaks in a Python script relies on memray to monitor memory allocations. It generates detailed reports that reveal exactly where and why memory accumulates, helping you resolve leaks and reduce overall memory consumption.

Can I profile async Python code paths with yappi?

Profiling async Python code paths is fully supported using yappi. It measures concurrent execution across coroutines and threads, providing accurate timing data for complex asynchronous workflows without blocking the event loop.

How do I generate a flame graph for a Python process?

Generate a flame graph for a Python process by running CPU profilers like py-spy or Scalene. They sample stack traces and output visual flame graphs that immediately highlight the most active functions consuming execution time.

Does line_profiler work for line-by-line timing in Python?

Line-by-line timing in Python works effectively with line_profiler. It measures the execution time of individual statements within a function, providing granular insights needed to optimize specific lines of code rather than whole functions.

What's the difference between py-spy and Scalene for CPU profiling?

For CPU profiling, py-spy samples stack traces with minimal overhead, while Scalene analyzes both CPU and memory at the line level. Choose py-spy for low-overhead sampling and Scalene for deeper line-level resource analysis.