Skip to main content

python package for tracing the performance of python code

Project description

pytracy

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 the documentation for build instructions).
  • Use the provided script for Ubuntu to install dependencies and build the Tracy Profiler - scripts\build_tracy_ubuntu.sh

Usage

  1. Enable the profiler
import pytracy
pytracy.enable_tracing(True)
  1. Start your script
  2. 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.

Mark function you want to measure

@pytracy.mark_function def function_you_want_to_measure(): pass

function_you_want_to_measure()


## Performance measurements
py .\utils\perf.py

Base				    	Average	80.00 ns	dev 45.87 ns
python profile_function 	Average 246.06 ns	dev 47.37 ns
PyTracy Debug(19587f466)	Average 3390.63 ns	dev 375.23 ns
PyTracy Release(19587f466)	Average 1441.24 ns	dev 66.48 ns
PyTracy Release(c6c8c803e)	Average 950.58 ns	dev 113.11 ns
PyTracy Release(a42aa86b5)	Average 760.63 ns	dev 49.53 ns

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pytracy-0.0.2rc0-cp313-cp313-win_amd64.whl (116.0 kB view details)

Uploaded CPython 3.13Windows x86-64

pytracy-0.0.2rc0-cp313-cp313-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pytracy-0.0.2rc0-cp313-cp313-musllinux_1_2_i686.whl (2.2 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

pytracy-0.0.2rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

pytracy-0.0.2rc0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

pytracy-0.0.2rc0-cp312-cp312-win_amd64.whl (116.0 kB view details)

Uploaded CPython 3.12Windows x86-64

pytracy-0.0.2rc0-cp312-cp312-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pytracy-0.0.2rc0-cp312-cp312-musllinux_1_2_i686.whl (2.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

pytracy-0.0.2rc0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pytracy-0.0.2rc0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

pytracy-0.0.2rc0-cp311-cp311-win_amd64.whl (116.1 kB view details)

Uploaded CPython 3.11Windows x86-64

pytracy-0.0.2rc0-cp311-cp311-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pytracy-0.0.2rc0-cp311-cp311-musllinux_1_2_i686.whl (2.2 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

pytracy-0.0.2rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pytracy-0.0.2rc0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

File details

Details for the file pytracy-0.0.2rc0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pytracy-0.0.2rc0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 116.0 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

Hashes for pytracy-0.0.2rc0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d3d8134eae5e82bb91c610013bc0faeaaafbf8f3682b77a9ffe337b521d64f1e
MD5 73d6673528aedcac9361d2f8c1ab69e4
BLAKE2b-256 2234b38a3ba4ba3ddfe89d158af27f52ade9ba53bcf7f5a6eddd31d006b238d8

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e711d9c55d3037815dee9eb54dacc869255ed7e4dad5d34696f992fedadf580f
MD5 89280cb916d545667fbafd63349851cf
BLAKE2b-256 0b30a2618b4b9bbca70957851f03f22581f09602c1bd577eb540f883c3419f94

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 189f29134a304ccd8f173344a47850a8cdd1484522d575b71c87883b764a7d15
MD5 336607e7af914a6be7f77350759b6ac1
BLAKE2b-256 24c89c7e27d9a897b13f6435a6d62e86620942c042447de459e849da6ba13c0c

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19ca7d5c63629b3f481ff8363f4b3dbf5cbc49556b658ab91536ea9b0f60bf63
MD5 4872a27e0aedcbacb6e9dc40074fe803
BLAKE2b-256 7161e94eef8a9cafa3e6d2c1c3c13a3acdcebbf8e6f0d5f0e7eeeebdab938857

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d37d421f456fc03545f73771c9900877f7be2346c7f84f868a14fcf45aa9966c
MD5 14c9d128900bdaf52090fcf00f03e9d1
BLAKE2b-256 25cb55ea8a8c902f8945468ea0f0dd82b308aaf3b74c84381213224a8d0c6bb3

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pytracy-0.0.2rc0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 116.0 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

Hashes for pytracy-0.0.2rc0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 54b450d5f80810e6a215fe4e73d7d4afd9bf6356b6ec29c5d536cc66442f7629
MD5 2a54799eafe96af8208ae118aeab6f5b
BLAKE2b-256 7feb5074dc1bf793060382d021ba49fa523b259edf75f576c42a4bd0873640e5

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dcca1cfff059ae92b074e041487c309ce8dc78275b18b172c7bed90a5c72fbb9
MD5 1c9daf34264c5a60f6ddd61451b963b2
BLAKE2b-256 83efbc53061af358b913f0e14d082c5250b43c9dc22584dc026c0f0208496d1c

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 bed618b8c26534fe5d6692fe2959a1354c6d7028fac53402de101374f18facb9
MD5 bfe189916c285af425ec55edf39fcfa1
BLAKE2b-256 ede9a7d247c5b2d75d965b35c02a4b72452007b4264fd25297f51a91002801ff

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6bd889c9148507033fc4341569d55bd150be25d79dc87b4e51b6660d3349fc9
MD5 d3450f044aac846f5f33b6ef2d336e37
BLAKE2b-256 748a8f3aea56024703ea38fe14f97d6c7c52a899588d33635ae9669a86da3e1d

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a9866af7f7ee077585bc50a7b96c1fe5ec1fde7049b90adebd196bf2ea82624e
MD5 45a2e7ee5be6683a3c3f272050683e40
BLAKE2b-256 41de7f7b11bc049a4c4932422a78269acce016f2e6146e0413d0a06191f83063

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pytracy-0.0.2rc0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 116.1 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

Hashes for pytracy-0.0.2rc0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fb9bb6a9213c355827bba4b3df99a74bb02d3b1c1f2b601811174637c9dd6d71
MD5 5c3a7f31a8a8d288a37b2eceb5c156f8
BLAKE2b-256 450517dd4b7f2b1655258f54ebc55bf13637fb0019c5987f4882100923617b8d

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e481d4f9eb42736bdb337b793355fcbc8a57667ba7b7b79b78d9fdf836c66e51
MD5 196ee8ecbc55eadd53e0f8cd3eeecbf0
BLAKE2b-256 f218d9c7780666ff3d81146bd09d52b5482db7d398d34602a6d3c91e80910a23

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2e8050ce686617f1a9be2213286a7ddbd0cb48ad82382da7204bf875f153b45e
MD5 0026af6377ef1cb30a99a1cfb00b2d1d
BLAKE2b-256 af41fcd0b142f7f687b4e288f891070a13cf4db9726b4bfea20417ea84aeee77

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5a58587d294ee92baf92d0708391fa6c670b96dcf6d93c7e81211cd82e439c8
MD5 2c4922be02bebef92acc88c539a7b48c
BLAKE2b-256 68b9b360d060b3f3dda1a6bed32586a49fae7e25dec3cc172d35839c70d2761f

See more details on using hashes here.

File details

Details for the file pytracy-0.0.2rc0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pytracy-0.0.2rc0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 528983901e68651e3ee150577a39e186b217c7352c506c97b14c9d10de4cb7a3
MD5 4936c68af0690b866567a143818f2ea8
BLAKE2b-256 074331d800de8cbc61f8cc8d2b1355f531cbe6f54fc3c41ceb0708b74a4f9669

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