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 hashes)
Built Distribution
Close
Hashes for valgrind-0.0.0-cp38-cp38-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fefd030f361ae4c2e9169c63a920f6aee80f43226adcf48b8131a458c8c1a9d |
|
MD5 | e24d5601065326457d46083e7ecb78ef |
|
BLAKE2b-256 | b5143964e97b308bf4266dde57816b61b973f3c8bc3f5f82d85888006acbb7e1 |