profile

Profile Python code with cProfile or line_profiler to identify bottlenecks.

1|Updated Dec 17, 2025
One-click install
npx skills add https://github.com/tatsuki-washimi/gwexpy --skill profile-tatsuki-washimi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: profile
Source: https://github.com/tatsuki-washimi/gwexpy/tree/main/.agent/skills/profile
Command: npx skills add https://github.com/tatsuki-washimi/gwexpy --skill profile-tatsuki-washimi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Profiling code to identify performance bottlenecks and optimize execution time.

Core Features & Use Cases

  • Multiple profiling modes: quick timing with time.perf_counter, sampling with cProfile, and line-by-line with line_profiler.
  • Bottleneck identification: automatically highlights hot paths and function-level hotspots.
  • Actionable recommendations: suggests vectorization, caching, or algorithm improvements based on results.

Quick Start

Run the profiler on your Python script to generate a report and identify bottlenecks.

Frequently Asked Questions about profile

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

FAQPage Schema
How do I profile Python code to identify performance bottlenecks?

Profile Python code using time.perf_counter, cProfile, or line_profiler to measure execution speed and identify bottlenecks. The profiler automatically highlights hot paths and function-level hotspots, generating a report with recommended optimizations like vectorization or caching.

When should I use cProfile vs line_profiler for Python performance profiling?

Use cProfile for sampling function-level execution speed across large codebases, and line_profiler for line-by-line performance tuning within specific hotspots. Quick timing measurements for individual scripts or modules use time.perf_counter to identify bottlenecks fast.

Can I profile execution speed for large Python codebases and complex workflows?

Yes, you can profile execution speed across small to large Python codebases and complex workflows. The profiler measures performance bottlenecks and generates a report with hotspot functions and recommended optimizations, scaling from individual scripts to full modules.

What's the best way to optimize Python functions after identifying bottlenecks?

After profiling identifies bottleneck hotspots, optimize Python functions by applying recommended improvements such as vectorization, caching, or algorithm enhancements. The generated profiling report provides actionable recommendations based on the measured execution speed results.

Do I need line_profiler installed to measure Python script execution time?

You do not need line_profiler exclusively, as time.perf_counter and cProfile also measure Python script execution time. The profiler requires interfaces for these three tools to identify bottlenecks and generate recommendations for performance tuning.