py-spy is a sampling profiler for Python programs. It lets you visualize what your Python program is spending time on without restarting the program or modifying the code in any way. py-spy is extremely low overhead: it is written in Rust for speed and doesn't run in the same process as the profiled Python program. This means py-spy is safe to use against production Python code. py-spy works from the command line and takes either the PID of the program you want to sample from or the command line of the python program you want to run. py-spy has three subcommands record, top and dump. py-spy supports recording profiles to a file using the record command. Top shows a live view of what functions are taking the most time in your python program, similar to the Unix top command.

Features

  • py-spy works on Linux, OSX, Windows and FreeBSD
  • Supports profiling all recent versions of the CPython interpreter
  • Prebuilt binary wheels can be installed from PyPI
  • py-spy can also display the current call stack for each python thread
  • Dump out the call stacks for each thread, and some other basic process info to the console
  • py-spy works by directly reading the memory of the python program

Project Samples

Project Activity

See All Activity >

Categories

Profiling

License

MIT License

Follow py-spy

py-spy Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of py-spy!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Rust

Related Categories

Rust Profiling Software

Registered

2021-08-06