Sampling Python Profiler
Project description
SPyProf
Sampling line-by-line Python profiler.
Installation
pip install https://github.com/yuriiz/spyprof
Usage
Import spyprof module at startup:
import spyprof
Profiling reports will be written to spyprof directory periodically every 10 seconds and at application exit.
Profiling report measured with ITIMER_REAL timer will be written to spyprof/real.html.
Profiling report measured with ITIMER_PROF timer will be written to spyprof/prof.html.
Example
Running following code:
import math
from time import sleep
import spyprof
def foo():
"""
CPU time consuming code.
"""
for i in range(10**8):
math.sqrt(i)
math.sqrt(i)
pass
def bar():
"""
Real time consuming code.
"""
sleep(10)
if __name__ == "__main__":
foo()
bar()
Will result in the following reports:
| real.html | prof.html |
|---|---|
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 spyprof-0.0.2.tar.gz.
File metadata
- Download URL: spyprof-0.0.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
895ae517556175cfc665da8115cb15b87650a0489a9be80c9a2875ccbc1bb7e8
|
|
| MD5 |
6f5c8b5a3f3a4cfdf027c9ec0acff1c7
|
|
| BLAKE2b-256 |
4f442dc5b4206d2d85a761aacd30fc5261b0ec2005ff988eadfedab030fed77f
|
Provenance
The following attestation bundles were made for spyprof-0.0.2.tar.gz:
Publisher:
python-publish.yml on yuriiz/spyprof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spyprof-0.0.2.tar.gz -
Subject digest:
895ae517556175cfc665da8115cb15b87650a0489a9be80c9a2875ccbc1bb7e8 - Sigstore transparency entry: 484421284
- Sigstore integration time:
-
Permalink:
yuriiz/spyprof@d48371097683ca58e5baf9ef62dbdf0d5b633b3f -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/yuriiz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d48371097683ca58e5baf9ef62dbdf0d5b633b3f -
Trigger Event:
release
-
Statement type:
File details
Details for the file spyprof-0.0.2-py3-none-any.whl.
File metadata
- Download URL: spyprof-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed30766f5066e14d494b73fd5a305f1a01f805f3b33bc57dd4bdb53032f4bcc
|
|
| MD5 |
bdd3e7593f41fc9314725cae38342d99
|
|
| BLAKE2b-256 |
0d8ee5fc285e6ce3ba1ec416f067a73b460a581ed18c2902893b6f24e705b464
|
Provenance
The following attestation bundles were made for spyprof-0.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on yuriiz/spyprof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spyprof-0.0.2-py3-none-any.whl -
Subject digest:
7ed30766f5066e14d494b73fd5a305f1a01f805f3b33bc57dd4bdb53032f4bcc - Sigstore transparency entry: 484421303
- Sigstore integration time:
-
Permalink:
yuriiz/spyprof@d48371097683ca58e5baf9ef62dbdf0d5b633b3f -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/yuriiz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d48371097683ca58e5baf9ef62dbdf0d5b633b3f -
Trigger Event:
release
-
Statement type: