memory_profiler
Monitor Memory usage of Python code (by pythonprofilers)
py-spy
Sampling profiler for Python programs (by benfred)
memory_profiler | py-spy | |
---|---|---|
6 | 25 | |
4,214 | 11,864 | |
0.6% | - | |
3.7 | 6.4 | |
19 days ago | 25 days ago | |
Python | Rust | |
BSD 3-clause "New" or "Revised" License | MIT 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.
memory_profiler
Posts with mentions or reviews of memory_profiler.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-04-10.
- Ask HN: C/C++ developer wanting to learn efficient Python
-
8 Most Popular Python HTML Web Scraping Packages with Benchmarks
memory_profiler
-
Check Python Memory Usage
pythonprofilers/memory_profiler: Monitor Memory usage of Python code
-
Profiling and Analyzing Performance of Python Programs
# https://github.com/pythonprofilers/memory_profiler pip install memory_profiler psutil # psutil is needed for better memory_profiler performance python -m memory_profiler some-code.py Filename: some-code.py Line # Mem usage Increment Occurrences Line Contents ============================================================ 15 39.113 MiB 39.113 MiB 1 @profile 16 def memory_intensive(): 17 46.539 MiB 7.426 MiB 1 small_list = [None] * 1000000 18 122.852 MiB 76.312 MiB 1 big_list = [None] * 10000000 19 46.766 MiB -76.086 MiB 1 del big_list 20 46.766 MiB 0.000 MiB 1 return small_list
-
Profiling Python code with memory_profiler
What do you do when your Python program is using too much memory? How do you find the spots in your code with memory allocation, especially in large chunks? It turns out that there is not usually an easy answer to these question, but a number of tools exist that can help you figure out where your code is allocating memory. In this article, I’m going to focus on one of them, memory_profiler.
- What Is Your Favorite Profilerperformance Tool
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.
What are some alternatives?
When comparing memory_profiler and py-spy you can also consider the following projects:
line_profiler
pyflame
profiling
pyinstrument - 🚴 Call stack profiler for Python. Shows you why your code is slow!
python-uncompyle6 - A cross-version Python bytecode decompiler
Laboratory - Achieving confident refactoring through experimentation with Python 2.7 & 3.3+
icecream - 🍦 Never use print() to debug again.
filprofiler - A Python memory profiler for data processing and scientific computing applications
memory_profiler vs line_profiler
py-spy vs pyflame
memory_profiler vs profiling
py-spy vs pyinstrument
memory_profiler vs pyflame
py-spy vs python-uncompyle6
memory_profiler vs Laboratory
py-spy vs icecream
memory_profiler vs filprofiler
py-spy vs line_profiler
memory_profiler vs python-uncompyle6
py-spy vs profiling