python package for tracing the performance of python code
Project description
pytracy
PyTracy is a python package that allows you to profile your python code using the Tracy profiler. It is a wrapper around the Tracy profiler, which is a real-time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications. PyTracy allows you to profile your python code with minimal overhead and visualize the results in the Tracy profiler.
Features
- Real-time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler
- Minimal overhead
- Easy integration with python code
- Support for free threaded python
Installation
Download the pytracy package using the following command:
pip install pytracy
To connect to a profiled application, you will need the Tracy profiler. Follow the steps below:
Download Tracy profiler from Tracy Github.
- For Windows, an executable is provided by the author.
- For Linux, you need to build it from the source (refer to Tracy documentation for build instructions).
Usage
- Enable the profiler
import pytracy
pytracy.enable_tracing(True)
- Start your script
- Start Tracy profiler and click connect
Limitations:
- Relatively high overhead. Enabling PyTracy currently average ~380ns per function call, compared to ~80ns for an untraced function call. The theoretical limit is an overhead of ~250ns per function call. This has been measured by giving the python profiler an empty function as a profiler callback.
- set_tracing_mode doesn't work for already started threads. It has to be called before other threads are started.
- No visibility into functions run using multiprocessing.
Goals for 0.3.0 release
- Mac support
- Shutdown and startup during program execution
- Changing of the tracing mode during runtime
- Easy integration with python logging
Goals for 0.4.0 release
- Offline mode - save trace to file
- Preinitialize all of the code objects, using gc module
Performance measurements
py .\utils\perf.py
| Test | Average | Std. Deviation |
|---|---|---|
| Base | 80.00 ns | 45.87 ns |
| python empty profile_function | 246.06 ns | 47.37 ns |
| PyTracy Debug(19587f466) | 3390.63 ns | 375.23 ns |
| PyTracy Release(19587f466) | 1441.24 ns | 66.48 ns |
| PyTracy Release(c6c8c803e) | 950.58 ns | 113.11 ns |
| PyTracy Release(a42aa86b5) | 760.63 ns | 49.53 ns |
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 Distributions
Built Distributions
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 pytracy-0.0.2rc5-cp313-cp313t-win_amd64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313t-win_amd64.whl
- Upload date:
- Size: 124.2 kB
- Tags: CPython 3.13t, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3038b3989c995dfd233b2b808f278fb06a0ffaa93e6ac7f53410c70101daf1c0
|
|
| MD5 |
81c678060d8e62e02d5e8e404bd5db10
|
|
| BLAKE2b-256 |
0cd8383f5d045d4c2a7e66848cb8e3e85d39c42c5b53d4fc019a685e1e7c1322
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313t-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313t-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13t, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
710256e1132354fd7f4888cea2282668e5ed91d22a8a691a75d08c1c8bd5ae79
|
|
| MD5 |
3797a5d0c5d1ea598b335f98ee412d5b
|
|
| BLAKE2b-256 |
4c08a5d35e020dc629e41e23dacf50c869e10bbe242685bb26e60a925bf77fc5
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313t-musllinux_1_2_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313t-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13t, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
174a89a1296d0c78e0eb6c93fe5f7db02d32d89fe125f7c07f4412262327b94c
|
|
| MD5 |
4dd1e15584dbcfb4840ca56aef186a45
|
|
| BLAKE2b-256 |
3994336a4693381b2d95260054f6711bc468546918efcb1fea3af63c58ff274f
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
255af3751aac77c27eaa6bbf0747430483217eb9cb7d7ad8a699deac02855f89
|
|
| MD5 |
0b25eb18caa9692cbf7cc394c7d9963a
|
|
| BLAKE2b-256 |
fb2ba046b08a51bbfb42a578ca0b2174f95846d3d93053f91919ea21a746febc
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d30e124dc13f664c257659089fac427bf534274e507e3c8959c0a1bbda5e0eb3
|
|
| MD5 |
f36c60f5482f3a3400a2eb9d7a94231b
|
|
| BLAKE2b-256 |
dcffccac34f41e56a891172a0242a0b5eac9c1f2ed10d031170687f78d6928cb
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 117.2 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70fffdd451949d45597eb146ca90e67e4ca02553d00d139ad6920458fed45df8
|
|
| MD5 |
724523ffe68fb42f2b920c84c8a5fa9f
|
|
| BLAKE2b-256 |
85d57d428dca4057a5160dd3f77aa8806a7580a79dd0436a8d7664be4be6402d
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a68c9f1b513c025266239fcd87387e8613c1f0d7abd2bb3bb8ad36f2ee663ea
|
|
| MD5 |
dd09e54d936f1b11977669837f54ef23
|
|
| BLAKE2b-256 |
3211176d37a8ec7c5e12911b5dc12e6fb1b199d4313388fcd20121c0a9bcf6b9
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313-musllinux_1_2_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c304454b821c04d196c9cdc287ee616db66b95ab4042d0f96c9fb0bf526c8c9
|
|
| MD5 |
17cba0c5521dadc75542ed081204e7d9
|
|
| BLAKE2b-256 |
517224945975f8a2b535174f8c4d31fc25b0ec58a662568e34d47c3843944435
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fc7702fb566d94b541e563b6b085fc13c12f3e8cbefc7a73e27b20286bebe4f
|
|
| MD5 |
ecff17ccd83ea5a87d6289150c070e06
|
|
| BLAKE2b-256 |
959aa2185234f751367e1e958fed16a38a6f284afc6feceb0e077071d1f63071
|
File details
Details for the file pytracy-0.0.2rc5-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40fafd0d77f484c697653eaf7cb846808f6303c679238eea299d3203908363c9
|
|
| MD5 |
c3bcf89c429cd882348aa715b85988d9
|
|
| BLAKE2b-256 |
895e593cd6dcf0fd5bfe23f00ea725bc419758711cf964823fbe4934b470ce28
|
File details
Details for the file pytracy-0.0.2rc5-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 117.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c71b34a2104e9c7c56da31e2251f3fcbf983ed04a353cdddeaefcf1744e26de1
|
|
| MD5 |
a044b41cef426a8b3f0d04fcae43b8a2
|
|
| BLAKE2b-256 |
8738828b646058e315757ab0339426f02edef35200af187d2203e56d61828be9
|
File details
Details for the file pytracy-0.0.2rc5-cp312-cp312-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp312-cp312-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f2585de92c56d50018410b5ea3d912145f501d3c1ee566614db804a32d6ead
|
|
| MD5 |
1b9339aefee88b59144f9c813ce8c8bc
|
|
| BLAKE2b-256 |
d9601cf173535134fc89b829e8f89babdcd02a32ade0895d88d861a41f8617dc
|
File details
Details for the file pytracy-0.0.2rc5-cp312-cp312-musllinux_1_2_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp312-cp312-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.12, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6cd6d52228c7a1c473c011324197fdcfc2a79f9c2221a45c3c3bc13dfe775e8
|
|
| MD5 |
d64fc054876c52550b3b4dcad3f1e9fa
|
|
| BLAKE2b-256 |
4a1bf6fe928544e272a2c0c9dc1a89af438250249eca8792c649b694ad887cfe
|
File details
Details for the file pytracy-0.0.2rc5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd57a9add931c490ff7e19e675c512ed858f58c49ee186800fa3ad247df37e25
|
|
| MD5 |
1d3b41d329cf58e5352c56049faf6457
|
|
| BLAKE2b-256 |
4fe4a76a17642ad19efa1e6fcaefad2aea9af073feaa1552c20f848ee0205f89
|
File details
Details for the file pytracy-0.0.2rc5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79e3828e461a89a6649e99ce72eb36367cdd78092c3711b6def3ecdfd7e1b471
|
|
| MD5 |
ce01424ec8fcc1434a3c1b801c60c4af
|
|
| BLAKE2b-256 |
09de0b8c2dbb437a1f7cc7d4a8ae5955812fc6c17c55e81b52e67ff9e98046a1
|
File details
Details for the file pytracy-0.0.2rc5-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 116.8 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1aae602de87e8dc1c6fc5bd2775b2aaa7929110aebbc471942d15f450950d99
|
|
| MD5 |
1e979a1fd2fad0cc6d4a02f084155d33
|
|
| BLAKE2b-256 |
73c533010b84adc63d82e02d7745e36458f72f624d7ded894126272bd0959aab
|
File details
Details for the file pytracy-0.0.2rc5-cp311-cp311-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp311-cp311-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32bda44efae1ff62ce99a05647f8e21494c9b99ab4d92bbb797ddc1fd57616fa
|
|
| MD5 |
75db1dfd046e208467346646aea70b4a
|
|
| BLAKE2b-256 |
7c60f636a400293687cbaa7b765cc3e9688e0995f19f99d3e72002cacaf66da6
|
File details
Details for the file pytracy-0.0.2rc5-cp311-cp311-musllinux_1_2_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp311-cp311-musllinux_1_2_i686.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.11, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdef1d64d6f79d5e3a3823a6d7119d439e31f372e5edb62b51cd2d1b7e3a1c64
|
|
| MD5 |
238145d8ccc6b9ecd21af808ef206564
|
|
| BLAKE2b-256 |
92f13aa5d775267795da236cc57139d1ecc7025aceb09c22d8c92955b91f882d
|
File details
Details for the file pytracy-0.0.2rc5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e17f8058404ae905c2424e1a7e3eda130600231c9178a5e4753f20ef067d29
|
|
| MD5 |
55568f667b20ba92504f6cd5fdcf820c
|
|
| BLAKE2b-256 |
da028c9ed3856593601375dbd6cddd014dd2df98e1b28918dccef308eeef405d
|
File details
Details for the file pytracy-0.0.2rc5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: pytracy-0.0.2rc5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ee0090aac1b8b4acf8e6c90825b11c4b6cd95927fa95d2aff67134e3db44455
|
|
| MD5 |
225ae7deaf5cceb0ca75c568b0043e9f
|
|
| BLAKE2b-256 |
8a873934951cc8bcd119eecec87b4c237ac758dba0a65189c313d862265c8ba7
|