Control callgrind instrumentation from Python.
Project description
valgrind
Usage
Run python3 -m pip install valgrind
.
In benchmark.py
put:
import valgrind
if __name__ == "__main__":
some_startup_code()
valgrind.callgrind_start_instrumentation()
some_expensive_function()
valgrind.callgrind_stop_instrumentation()
valgrind.callgrind_dump_stats("myprofile")
Run valgrind --tool=callgrind --instr-atstart=no python3 benchmark.py
.
See profile in myprofile
file. Consider opening with KCachegrind or
QCachegrind.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
valgrind-0.0.0.tar.gz
(47.2 kB
view details)
Built Distribution
File details
Details for the file valgrind-0.0.0.tar.gz
.
File metadata
- Download URL: valgrind-0.0.0.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | feb5e5705362b48485a64596c13571897684f0e378f1cffa095c06bb1defe80b |
|
MD5 | 8532aee5b9e6c7cdf0c14c3a22e4f074 |
|
BLAKE2b-256 | 5673299e994e6627bd69fba31901b6234ed45b15413af720d598459f1840c836 |
File details
Details for the file valgrind-0.0.0-cp38-cp38-macosx_10_6_x86_64.whl
.
File metadata
- Download URL: valgrind-0.0.0-cp38-cp38-macosx_10_6_x86_64.whl
- Upload date:
- Size: 4.2 kB
- Tags: CPython 3.8, macOS 10.6+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fefd030f361ae4c2e9169c63a920f6aee80f43226adcf48b8131a458c8c1a9d |
|
MD5 | e24d5601065326457d46083e7ecb78ef |
|
BLAKE2b-256 | b5143964e97b308bf4266dde57816b61b973f3c8bc3f5f82d85888006acbb7e1 |