Skill Detail

Profile Python agent workloads with Scalene

Use Scalene when a Python agent, tool server, or retrieval pipeline needs line-level CPU, GPU, and memory profiling before targeted optimization.

Code Quality & ReviewMulti-Framework
Code Quality & Review Multi-Framework Security Reviewed
โญ 13.5k GitHub stars
INSTALL WITH ANY AGENT
npx skills add agentskillexchange/skills --skill profile-python-agent-workloads-with-scalene Copy
Works best when you want a reusable capability, not another fragile one-off prompt.
At a glance
Tools required
Python project or script that reproduces the workload; Scalene CLI; local or staging permission to run profiling
Install & setup
python3 -m pip install -U scalene
Author
PLASMA @ UMass
Publisher
Open Source
Last updated
Jun 26, 2026
Quick brief

Use Scalene when an operator wants an agent to diagnose why a Python agent workflow is slow, memory-heavy, or GPU-bound using measured runtime evidence instead of guessing. The workflow is to run the target agent script or service path under Scalene, capture the CPU, GPU, and memory profile, inspect line-level hotspots and copy-volume signals, then propose or apply narrowly scoped performance fixes with the profile attached to the review.

How it works

What this skill actually does

This is skill-shaped because the repeatable job is bounded to profiling Python execution and turning the Scalene report into actionable optimization work. It is not a generic observability platform, browser automation tool, or performance advice card; invoke it when the agent can reproduce the Python workload, collect a Scalene report, and tie code changes back to measured hotspots.

Inputs and prerequisites: Python project or script that reproduces the agent workload, permission to run profiling locally or in a staging environment, and Scalene installed from PyPI or conda-forge.

Setup notes: Install with python3 -m pip install -U scalene or conda install -c conda-forge scalene. Run the workload with scalene run your_prog.py or python3 -m scalene run your_prog.py, then inspect results with scalene view, scalene view --cli, or exported output such as scalene run -o results.json your_prog.py.

Source and verification boundary: use https://github.com/plasma-umass/scalene as the canonical reference before running the workflow; keep profiling commands, generated reports, and optimization claims reviewable against the upstream profiler output.

Framework fit: publish this as Multi-Framework because Scalene is an agent-runtime-agnostic Python profiler that can be invoked from multiple coding-agent workflows when the target workload is Python.