py-spy
Sampling profiler for Python programs (by benfred)
pyinstrument
š“Ā Call stack profiler for Python. Shows you why your code is slow! (by joerick)
Our great sponsors
py-spy | pyinstrument | |
---|---|---|
25 | 11 | |
11,850 | 6,125 | |
- | - | |
6.4 | 7.7 | |
17 days ago | 10 days ago | |
Rust | Python | |
MIT License | BSD 3-clause "New" or "Revised" License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
py-spy
Posts with mentions or reviews of py-spy.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-03-13.
- Minha jornada de otimizaĆ§Ć£o de uma aplicaĆ§Ć£o django
- Graphical Python Profiler
-
Grasshopper ā An Open Source Python Library for Load Testing
For CPU cycles, py-spy[0] is getting more and more used. For RAM, I would like to known too...
[0] -- https://github.com/benfred/py-spy
-
Debugging a Mixed Python and C Language Stack
Theres also Py Spy, a profiling tool that can generate flame charts containing a mix of python and C (or C++) calls.
https://github.com/benfred/py-spy
It's worked really well for my needs
-
python to rust migration
You should profile your consumer to check the bottlenecks. You can use the excellent py-spy(written in Rust). IMO a few usage of Numba there and there should solve your performance issues.
-
Has anyone switched from numpy to Rust?
So as a first step you'll want to profile your program to figure out where it's slow, and hopefully that'll also tell you why it's slow. I'm the (biased) author of the Sciagraph profiler which is designed for this sort of application (https://sciagraph.com) but you can also try py-spy, which isn't as well designed for data processing/analysis applications (e.g. it won't visualize parallelism at all) but can still be informative (https://github.com/benfred/py-spy). Both are written in Rust ;)
-
Trace your Python process line by line with minimal overhead!
Any advantages/disadvantages compared to py-spy [1]?
[1]: https://github.com/benfred/py-spy
-
Python 3.11 delivers.
Python profiling is enabled primarily through cprofile, and can be visualized with help of tools like snakeviz (output flame graph can look like this). There are also memory profilers like memray which does in-depth traces, or sampling profilers like py-spy.
-
Tales of serving ML models with low-latency
A good profiler would be https://github.com/benfred/py-spy . If you run your app/benchmark with it, it should be able to draw a flamegraph telling you where the majority of time is spent. The info here is quite fine grained so it would already tell you where the bottleneck is. Without a full-fledged profiler you can also measure the timings in various parts of the code to understand where the bottleneck is.
-
Profiling a Python library written in Rust (Maturin)
Might be worth raising an issue on py-spy (a python profiler written in rust which "supports profiling native python extensions written in languages like C/C++ or Cython" to see if that can close the loop.
pyinstrument
Posts with mentions or reviews of pyinstrument.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-07-05.
-
How to profile an asynchronous FastAPI server
I was wondering if you have any synchronous routes in your app? We have an open issue regarding those and would love some ideas for solutions :)
- How to expand to full traceback
-
Graphical Python Profiler
Is there something about the actual profiler that differs from existing tools like pyinstrument [1] or py-spy [2]? I know pyinstrument has various output options and I wonder if it could potentially output something readable by the Firefox Profiler tool.
[1] : https://github.com/joerick/pyinstrument
-
DRF Performance (How bad is this code?)
I would highly recommend looking into pyinstrument to profile your requests. I find the reports to be very readable, and it's very easy to setup with Django.
- Looking for app that visualizes python program
-
What are some python micro optimisations that you can/may *actually use* in your codebase?
I like to use pyinstrument for profiling. Uses stat sampling so it's quicker and builds a easy to grok report.
- (How to) profile python code?
-
Profiling async code with pyinstrument 4.0
Hello! I just released pyinstrument 4.0 on PyPI. pyinstrument was my first successful open-source package and I love seeing how much use it's getting in the community.
-
Getting started on profiling with python
PyInstrument, compared to cProfile or Yappi, it's a lot easier to use and requires much less configuration.
-
Looking Beyond Nox
Run pytest, under pyinstrument, and generate a webpage that presents performance data, in addition to a separate junit xml report.
What are some alternatives?
When comparing py-spy and pyinstrument you can also consider the following projects:
pyflame
yappi - Yet Another Python Profiler, but this time multithreading, asyncio and gevent aware.
python-uncompyle6 - A cross-version Python bytecode decompiler
memray - Memray is a memory profiler for Python
memory_profiler - Monitor Memory usage of Python code
austin - Python frame stack sampler for CPython
icecream - š¦ Never use print() to debug again.
Bazel - a fast, scalable, multi-language and extensible build system
line_profiler
junit2html
profiling
doit - task management & automation tool