viztracer
A debugging and profiling tool that can trace and visualize python code execution
Decision gist · record as of 2026-08-14
Yes. VizTracer is a mature, actively maintained profiler with no security issues, minimal dependencies, and broad platform support. It solves a real problem (understanding code execution flow and performance) with low overhead and a polished UI. The Apache-2.0 license is permissive. Install it if you need to profile or debug Python execution; the command-line interface requires no code changes for initial exploration.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Compiled wheels available for Linux, macOS, and Windows; source build may require a C compiler on unsupported platforms.
- Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.14).
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most development and production environments.
last release 2025-11-11 (276 days) · last repo commit 2026-06-08 · 7,720 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,716,360 downloads/mo, #3,622 on PyPI
Alternatives
Verify before relying
pip install viztracer
# Command line: trace a script
viztracer my_script.py arg1 arg2
# Or inline in code:
from viztracer import VizTracer
tracer = VizTracer()
tracer.start()
# code to trace
tracer.stop()
tracer.save()- Exact overhead percentage for typical real-world applications (description mentions 'below 1x' but measurement methodology unclear)
- Whether orjson is automatically installed or only recommended as optional for faster JSON export
What it is and what it does
VizTracer is a low-overhead execution tracer that records function entry and exit events, then visualizes them in an interactive timeline UI powered by Perfetto. It works as a command-line tool (no code changes needed for basic tracing) or as an inline context manager for programmatic control. The tracer captures detailed timing information and renders it in a browser-based viewer that supports zooming, filtering, and flamegraph generation.
The tool is designed to handle concurrent code: it natively supports threading (Python 3.12+ without modification, earlier versions with native threading module), multiprocessing, subprocess, asyncio, and PyTorch profiling. It also supports remote attach to running processes and can log extra information like variable values, function arguments, and exceptions without modifying source code. The fact sheet indicates it is actively maintained, production-stable, and has no known security vulnerabilities.
Use it for
- Identify performance bottlenecks in CPU-bound Python code by visualizing which functions consume the most time
- Debug multi-threaded or async applications by seeing how threads and coroutines interleave and where blocking occurs
- Profile PyTorch model training to understand GPU event timing and native call overhead
- Trace subprocess and multiprocessing workflows to understand inter-process communication and timing
- Generate flamegraphs from trace data to quickly spot hot code paths in large applications
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
VizTracer is a mature, actively maintained profiler with no security issues, minimal dependencies, and broad platform support. It solves a real problem (understanding code execution flow and performance) with low overhead and a polished UI. The Apache-2.0 license is permissive. Install it if you need to profile or debug Python execution; the command-line interface requires no code changes for initial exploration.
Install
viztracer on PyPI
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.14). Active maintenance with recent commits and stable production status. Single runtime dependency (objprint) keeps the dependency surface minimal.
Requires Python 3.10 or later. Compiled wheels available for Linux, macOS, and Windows; source build may require a C compiler on unsupported platforms.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most development and production environments.
Quickstart
pip install viztracer
# Command line: trace a script
viztracer my_script.py arg1 arg2
# Or inline in code:
from viztracer import VizTracer
tracer = VizTracer()
tracer.start()
# code to trace
tracer.stop()
tracer.save()
Verify before relying
- Exact overhead percentage for typical real-world applications (description mentions 'below 1x' but measurement methodology unclear)
- Whether orjson is automatically installed or only recommended as optional for faster JSON export
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packageobjprint |
| Maintenance | Actively maintained 276 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,716,360 / month, #3,622 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free ThreadingProgramming Language :: Python :: Free Threading :: 3 - StableTopic :: Software Development :: Bug TrackingTopic :: Software Development :: Quality AssuranceTopic :: System :: Logging |
Evidence: viztracer-1.1.1-cp310-cp310-macosx_11_0_arm64.whl; viztracer-1.1.1-cp310-cp310-macosx_11_0_x86_64.whl; viztracer-1.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; viztracer-1.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; viztracer-1.1.1-cp310-cp310-win32.whl; viztracer-1.1.1-cp310-cp310-win_amd64.whl; viztracer-1.1.1-cp311-cp311-macosx_11_0_arm64.whl; viztracer-1.1.1-cp311-cp311-macosx_11_0_x86_64.whl; viztracer-1.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; viztracer-1.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; viztracer-1.1.1-cp311-cp311-win32.whl; viztracer-1.1.1-cp311-cp311-win_amd64.whl; viztracer-1.1.1-cp312-cp312-macosx_11_0_arm64.whl; viztracer-1.1.1-cp312-cp312-macosx_11_0_x86_64.whl; viztracer-1.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; viztracer-1.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; viztracer-1.1.1-cp312-cp312-win32.whl; viztracer-1.1.1-cp312-cp312-win_amd64.whl; viztracer-1.1.1-cp313-cp313-macosx_11_0_arm64.whl; viztracer-1.1.1-cp313-cp313-macosx_11_0_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python code profiler tracer”
- viztracerVizTracer traces Python code execution and generates interactive…
- hunterHunter is a code tracing toolkit that intercepts and logs function…
- barectfbarectf generates ANSI C tracers that output CTF (Common Trace…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also httpdbg · perfetto · barectf · keke · line-profiler · nvidia-nvtx · memray · gprof2dot · snakeviz · hunter