Metadata-Version: 2.1
Name: valgrind
Version: 0.0.0
Summary: Control callgrind instrumentation from Python.
Home-page: https://github.com/tekknolagi/valgrind
Author: Max Bernstein
Author-email: python@bernsteinbear.com
Description-Content-Type: text/markdown
License-File: LICENSE

# `valgrind`

## Usage

Run `python3 -m pip install valgrind`.

In `benchmark.py` put:

```python
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.
