A stupid simple memory profiler.
Project description
profile-this
Sometimes you need sophisticated line-by-line profiling for optimizing my Python code. Other times, you just want a basic temporal line plot showing memory allocation.
There are plenty of tools for the former use-case, e.g. py-spy or vprof. But I am not aware of any tools for the latter use-case -- probably because no one wants to release something so basic.
profile-this is a stupid simple memory profiler for people who just want a basic memory profiling plot without writing one from scratch.
Example
Install it like this:
pip install profile-this
Do this:
from random import randint
from profile_this import ProfileThis
def func(n=10_000_000):
return sum([randint(0, i + 1) for i in range(n)])
profiler = ProfileThis()
profiler.start()
func()
profiler.stop()
profiler.plot(
title="Profile for func", path="docs/func.png"
)
To get this:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file profile_this-0.1.0.tar.gz.
File metadata
- Download URL: profile_this-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cf0ca6bdf921eb0122498b9d0dcbb05361e2df541fe0ea92d6ca4e6ccc42f5a
|
|
| MD5 |
e4cc8c0c9a46dd8edcdb87547b470c2a
|
|
| BLAKE2b-256 |
264aa79008ebfc4be1bccb8584951ff154081c61839866012239b771f675f5fb
|
File details
Details for the file profile_this-0.1.0-py3-none-any.whl.
File metadata
- Download URL: profile_this-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65471c76437460556c769b5309038322e23120873c9d6f7bad77af0832c399a4
|
|
| MD5 |
5dfd32a1e8c087feb990ce16dcef9c15
|
|
| BLAKE2b-256 |
fe9bf1e9e4e7bd5ba0df20b7486fcf8dcde7b28b2f8187a2046dc3c56ee4bff7
|