Skip to main content
PyPI version

A simple profiling decorator:

In [1]: from profiled import profiled, Profiler

In [2]: @profiled
   ...: def get_answer():
   ...:     return 42
   ...:

In [3]: profiler = Profiler()

In [4]: with profiler:
   ...:     for i in range(100000): get_answer()
   ...:

In [5]: profiler.compute_stats()
Out[5]:
{'get_answer': {'avg': 2.2763967514038087e-07,
  'max': 0.00016736984252929688,
  'min': 0.0,
  'num': 100000,
  'std': 6.953436521202228e-07,
  'tot': 0.022763967514038086}}

The decorator also works with class methods. That’s about it.

Install with pip install profiled.

Metadata

Release files for profiled 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for profiled 2.0.0
File Size Uploaded
profiled-2.0.0.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for profiled 2.0.0
File Interpreter ABI Platform
profiled-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.3 kB

Release files / profiled-2.0.0.tar.gz

Download URL profiled-2.0.0.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3bedc516d5f549ea5a8fd2b92287014952b8d6ea38fdf380ab0f0359558efe1c
BLAKE2b-256 checksum
How to use checksums
77bc07a086c761bbdb70e0f1ffa17db27586c5b81006d2eadc6d4f4169664812
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-39-generic

Release files / profiled-2.0.0-py3-none-any.whl

Download URL profiled-2.0.0-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8a2c59005c00e65bcc1607b0c06549812f42d7e518f470b4a57fd7e9541b4a2
BLAKE2b-256 checksum
How to use checksums
d1c1f75418cddcd9913addb625859190cc061011ef3ba58a5f84a1e8a6d6d6e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-39-generic

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.0

1 release file

0.1.0

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page