Metadata-Version: 2.1
Name: profiling-helpers
Version: 0.1.0
Summary: A small utility library that wraps cProfile and makes it easy to debug performance problems in your Python code.
Home-page: https://github.com/NobisIndustries/python-profiling-helpers
Author: Fabian Nobis
Author-email: fabiannobis@gmx.de
License: MIT
Project-URL: Bug Tracker, https://github.com/NobisIndustries/python-profiling-helpers/issues
Keywords: cProfile,profiling,performance
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# Profiling Helpers

A small python package that wraps Python's own `cProfile` library to make it more user friendly.


When developing Python programs, you'll sometimes have functions that take a long time to execute and
you are really not sure why. Profiling helps to find and analyze these bottlenecks and guides you
into fixing performance problems. Uses [snakeviz](https://jiffyclub.github.io/snakeviz/) for interactive visualizations.

Install it with `pip install profiling-helpers`.

There are two decorators, `time_it` and `profile_it`. Use them anywhere in your code, like this:

```python
from profiling_helpers import time_it, profile_it
from time import sleep

@time_it
def my_slow_function(x):
    sleep(10)
    return x

my_slow_function(42)  # Prints: Function "my_slow_function" took 10.01061 s to run
```


```python
@profile_it("my/profile/save/dir", open_visualization=True)
def my_slow_function(x):
    sleep(10)
    return x

my_slow_function(42)  # Opens snakeviz after this function is completed
```
