tuna
Visualize Python performance profiles
What it is and what it does
tuna is a lightweight Python profile viewer that reads output from Python's built-in cProfile and importtime profilers and displays them in an interactive web interface. It was designed as a modern alternative to SnakeViz, focusing on accuracy: it only displays timing information that can be reliably reconstructed from profile data, avoiding the incorrect call-tree reconstructions that SnakeViz produces. The tool uses d3 and bootstrap for visualization and has no runtime dependencies, making it quick to install and run.
You generate a profile by running your Python code with cProfile or importtime, then pass the resulting file to tuna's command-line interface. tuna launches a web viewer showing the call tree, function timings, and performance bottlenecks. It also includes IPython magic commands for profiling code directly in notebooks, offering a drop-in replacement for the prun magic.
Use it for:
- Identify which functions consume the most CPU time in a Python application.
- Analyze import-time performance to find slow module initialization.
- Debug performance regressions by comparing profiles across code versions.
- Visualize call hierarchies to understand which code paths dominate execution time.
- Profile IPython/Jupyter notebooks using the tuna magic command.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
tuna visualizes Python performance profiles in an interactive web interface, showing runtime and import-time profiling data with minimal dependencies.
Yes. tuna is actively maintained, has no runtime dependencies, supports current Python versions (3.10+), and solves a real problem—accurate profile visualization—that SnakeViz handles incorrectly. The GPLv3 license is a constraint for proprietary use but not a blocker for most development workflows. Install it if you need to understand where your Python code spends time.
Install
tuna on PyPI
pip
pip install tunauv
uv add tunapoetry
poetry add tunaInstalling tuna
Before you install
Low friction: pure Python wheel with no runtime dependencies. Actively maintained as of June 2026, with 1597 repository stars and regular releases since 2018.
License in practice
GPLv3 copyleft license. Any derivative work or distribution must also be licensed under GPLv3; using tuna in proprietary projects requires careful consideration of linking and distribution obligations.
Quickstart
pip install tuna
python -mcProfile -o program.prof yourfile.py
tuna program.prof
Requires Python 3.10 or later.
Verify before relying
- Whether the web interface requires a specific browser or JavaScript runtime to function.
- Whether tuna can be used programmatically as a library or only as a CLI tool.
- Performance characteristics when analyzing very large profile files.
Package facts
| License | GPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 87 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 252,687/month — #8,537 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tuna-0.5.15-py3-none-any.whl
Keywords: performance, profile, visualization
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pyprof2calltreeConverts Python cProfile profiling data into…
permissive · top 15,000 on PyPI
snakevizSnakeViz is a web-based viewer for Python…
permissive · top 5,000 on PyPI
line-profilerline_profiler measures execution time on a…
permissive · top 5,000 on PyPI
pyinstrumentPyinstrument is a statistical call-stack…
permissive · top 5,000 on PyPI
tensorboard-plugin-profileProvides a TensorBoard plugin and standalone…
permissive · top 5,000 on PyPI
scaleneScalene profiles Python code to measure CPU,…
permissive · top 15,000 on PyPI
flameprofConverts Python cProfile statistics into…
permissive · top 15,000 on PyPI
fastapi-profilerIntegrates pyinstrument profiling into FastAPI…
permissive · top 15,000 on PyPI
kekeWrites trace events in Perfetto/Chrome trace…
permissive · top 15,000 on PyPI
guppy3Guppy 3 analyzes Python heap memory to identify…
permissive · top 5,000 on PyPI