{"id":13467589,"url":"https://github.com/nvdv/vprof","last_synced_at":"2025-05-14T02:07:02.551Z","repository":{"id":38419983,"uuid":"38226908","full_name":"nvdv/vprof","owner":"nvdv","description":"Visual profiler for Python","archived":false,"fork":false,"pushed_at":"2022-07-15T07:43:03.000Z","size":1104,"stargazers_count":3965,"open_issues_count":30,"forks_count":153,"subscribers_count":69,"default_branch":"master","last_synced_at":"2025-04-30T09:55:15.010Z","etag":null,"topics":["cpu-flame-graph","d3","developer-tools","javascript","profiler","python","stats","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvdv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-29T03:59:39.000Z","updated_at":"2025-04-29T10:52:47.000Z","dependencies_parsed_at":"2022-08-09T04:00:21.503Z","dependency_job_id":null,"html_url":"https://github.com/nvdv/vprof","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvdv%2Fvprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvdv%2Fvprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvdv%2Fvprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvdv%2Fvprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvdv","download_url":"https://codeload.github.com/nvdv/vprof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052743,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpu-flame-graph","d3","developer-tools","javascript","profiler","python","stats","visualization"],"created_at":"2024-07-31T15:00:58.268Z","updated_at":"2025-05-14T02:06:57.537Z","avatar_url":"https://github.com/nvdv.png","language":"Python","readme":"[![PyPI](https://img.shields.io/pypi/v/vprof.svg)](https://pypi.python.org/pypi/vprof/)\n\n# vprof\n\nvprof is a Python package providing rich and interactive visualizations for\nvarious Python program characteristics such as running time and memory usage.\nIt supports Python 3.4+ and distributed under BSD license.\n\nThe project is in active development and some of its features might not work as\nexpected.\n\n## Screenshots\n![vprof-gif](http://i.imgur.com/ikBlfvQ.gif)\n\n## Contributing\nAll contributions are highly encouraged! You can add new features,\nreport and fix existing bugs and write docs and tutorials.\nFeel free to open an issue or send a pull request!\n\n## Prerequisites\nDependencies to build `vprof` from source code:\n * Python 3.4+\n * `pip`\n * `npm` \u003e= 3.3.12\n\n`npm` is required to build `vprof` from sources only.\n\n## Dependencies\nAll Python and `npm` module dependencies are listed in `package.json` and\n`requirements.txt`.\n\n## Installation\n`vprof` can be installed from PyPI\n\n```sh\npip install vprof\n```\n\nTo build `vprof` from sources, clone this repository and execute\n\n```sh\npython3 setup.py deps_install \u0026\u0026 python3 setup.py build_ui \u0026\u0026 python3 setup.py install\n```\n\nTo install just `vprof` dependencies, run\n\n```sh\npython3 setup.py deps_install\n```\n\n## Usage\n\n```sh\nvprof -c \u003cconfig\u003e \u003csrc\u003e\n```\n`\u003cconfig\u003e` is a combination of supported modes:\n\n* `c` - CPU flame graph  ⚠️ **Not available for windows [#62](https://github.com/nvdv/vprof/issues/62)**\n\nShows CPU flame graph for `\u003csrc\u003e`.\n\n* `p` - profiler\n\nRuns built-in Python profiler on `\u003csrc\u003e` and displays results.\n\n* `m` - memory graph\n\nShows objects that are tracked by CPython GC and left in memory after code\nexecution. Also shows process memory usage after execution of each line of `\u003csrc\u003e`.\n\n* `h` - code heatmap\n\nDisplays all executed code of `\u003csrc\u003e` with line run times and execution counts.\n\n`\u003csrc\u003e` can be Python source file (e.g. `testscript.py`) or path to package\n(e.g. `myproject/test_package`).\n\nTo run scripts with arguments use double quotes\n\n```sh\nvprof -c cmh \"testscript.py --foo --bar\"\n```\n\nModes can be combined\n\n```sh\nvprof -c cm testscript.py\n```\n\n`vprof` can also profile functions. In order to do this,\nlaunch `vprof` in remote mode:\n\n```sh\nvprof -r\n```\n\n`vprof` will open new tab in default web browser and then wait for stats.\n\nTo profile a function run\n\n```python\nfrom vprof import runner\n\ndef foo(arg1, arg2):\n    ...\n\nrunner.run(foo, 'cmhp', args=(arg1, arg2), host='localhost', port=8000)\n```\n\nwhere `cmhp` is profiling mode, `host` and `port` are hostname and port of\n`vprof` server launched in remote mode. Obtained stats will be rendered in new\ntab of default web browser, opened by `vprof -r` command.\n\n`vprof` can save profile stats to file and render visualizations from\npreviously saved file.\n\n```sh\nvprof -c cmh src.py --output-file profile.json\n```\n\nwrites profile to file and\n\n```sh\nvprof --input-file profile.json\n```\nrenders visualizations from previously saved file.\n\nCheck `vprof -h` for full list of supported parameters.\n\nTo show UI help, press `h` when visualizations are displayed.\n\nAlso you can check `examples` directory for more profiling examples.\n\n## Testing\n\n```sh\npython3 setup.py test_python \u0026\u0026 python3 setup.py test_javascript \u0026\u0026 python3 setup.py e2e_test\n```\n\n## License\n\nBSD\n","funding_links":[],"categories":["Debugging Tools","Python","资源列表","Debugging \u0026 Profiling \u0026 Tracing","调试工具","Debugging Tools [🔝](#readme)","Awesome Python"],"sub_categories":["调试工具","For Python","Other dialects and variants","Debugging Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvdv%2Fvprof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvdv%2Fvprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvdv%2Fvprof/lists"}