Skip to content
프로젝트

소개

Python용 시각적 프로파일러

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-4
in 1 month
-4

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

PyPI

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.

vprof

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

BSD 2-Clause

관련 프로젝트 살펴보기

불러오는 중…