Skip to main content

A stupid simple memory profiler.

Project description

profile-this

Sometimes you need sophisticated line-by-line profiling for optimizing your Python code. Other times, you just want a quick and basic memory profile chart.

There are plenty of tools for the former use-case, e.g. py-spy or vprof. But not many (or any) tools for the latter use-case.

profile-this is a stupid simple memory profiler for people who just want a basic memory profiling plot without writing one from scratch.

Links

Source Code

PyPI

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:

func image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

profile_this-0.1.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

profile_this-0.1.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file profile_this-0.1.3.tar.gz.

File metadata

  • Download URL: profile_this-0.1.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/22.6.0

File hashes

Hashes for profile_this-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4aaf1c4db5ae35fb726251e118048b5cdeadffd46e962cd46c787dbc7e27e314
MD5 9f88cc54f8c6ee70539ec0ee5e7a4986
BLAKE2b-256 8f8a79560b54fbce43a1910fdf49c0a66c9d993902a218ed71462507b4452f51

See more details on using hashes here.

File details

Details for the file profile_this-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: profile_this-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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

Hashes for profile_this-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6190a2cc9a5c006e202b83d6b442dd0fa05d349637c02d30cfaca0e810de8118
MD5 b9f0f218c7b26b25f5cf60da4e2f92bf
BLAKE2b-256 d366e008729e76ab505bb1c7a027a646906f0ad3718dc36db1692797893e0d13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page