nvdv/vprof
关于
Python 可视化分析器
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -4
- 1个月
- -4
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文vprof
vprof is a Python package providing rich and interactive visualizations for
various Python program characteristics such as running time and memory usage.
It supports Python 3.10+ and is distributed under the BSD 2-Clause license.

Installation
Install from PyPI or run directly without installing via uvx:
uv tool install vprof
# or
pip install vprof
# or run without installing
uvx vprof -c cmhp script.py
Usage
vprof -c <config> <src>
<config> combines one or more modes:
c— CPU flame graph ⚠️ Not available on Windows (#62)p— built-in Python profiler (cProfile)m— memory graph (line-by-line process RSS and remaining GC-tracked objects)h— code heatmap (per-line run times and execution counts)
<src> is a Python file (script.py) or package directory (myproject/pkg). Quote scripts with arguments:
vprof -c cmh "script.py --foo --bar"
Profiling functions
Start the remote server (opens a browser tab and waits for stats):
vprof -r
Run the target function:
from vprof import rprofile
@rprofile('cmhp')
def foo(x):
...
Or invoke directly via runner.run(foo, 'cmhp', args=(arg1, arg2), host='localhost', port=8000).
host and port default to VPROF_HOST / VPROF_PORT (or localhost:8000) for both vprof CLI and runner.run().
Saving and loading profiles
vprof -c cmh src.py --output-file profile.json
vprof --input-file profile.json
Run vprof -h for all options. In the UI, click ? (top-left) or press h for help. See examples/ for sample scripts.
Development
Requires Python 3.10+, uv, and Node.js / npm (source builds only; see pyproject.toml and package.json).
uv sync && npm install && make build-ui
make build-ui (npm run build) generates vprof/ui/vprof_min.js (required before running from source or running make build).
Tests
make test
Lint & Typecheck
make check
Contributing
See CONTRIBUTING.md.
License
探索相关项目
加载中…