coveragepy
The code coverage tool for Python (by nedbat)
scalene
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python with AI-powered optimization proposals (by plasma-umass)
coveragepy | scalene | |
---|---|---|
7 | 36 | |
3,232 | 12,908 | |
0.9% | 0.7% | |
9.8 | 9.2 | |
4 days ago | 7 days ago | |
Python | Python | |
Apache License 2.0 | Apache License 2.0 |
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.
coveragepy
Posts with mentions or reviews of coveragepy.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-02-14.
-
An Introduction to Testing with Django for Python
Coverage.py is the go-to tool for measuring code coverage of Python programs. Once installed, you can use it with either unittest or pytest.
-
The Uncreative Software Engineer's Compendium to Testing
Code Coverage Analysis assess the code portions tested by the current test suites without altering the code.
-
Slipcover: Near Zero-Overhead Python Code Coverage
The PLASMA lab @ UMass Amherst (home of the Scalene profiler) has released a new version of Slipcover, a super fast code coverage tool for Python. It is by far the fastest code coverage tool: in our tests, its average slowdown is just 5% (compare to the widely used coverage.py, average slowdown 218%!). The latest release performs both line and branch coverage with virtually no overhead. Use it to dramatically speed up your tests and continuous integration!
-
Unit Tests - what’s the point?
Tests ensure the tested behavior is maintained. It's up to the developers to write tests with sufficient coverage. Determining which lines of code on your project are covered by tests is easily quantifiable using tooling. E.g. https://coverage.readthedocs.io/
-
How to make Django package smaller for Serverless deployment
Taking the idea further, if you build robust tests for your API, you could use a dynamic code analyzer like coverage or figleaf to identify and delete unused functions.
-
Comparison of Python TOML parser libraries
coverage
-
New Ways to Be Told That Your Python Code Is Bad
FWIW, ternary expressions aren't properly detected by coverage: https://github.com/nedbat/coveragepy/issues/509
scalene
Posts with mentions or reviews of scalene.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2025-01-06.
-
LLMs and Code Optimization
This has been a feature of the Scalene Python profiler (https://github.com/plasma-umass/scalene) for some time (at this point, about 1.5 years) - bring your own API key for OpenAI / Azure / Bedrock, also works with Ollama. Optimizing Python code to use NumPy or other similar native libraries can easily yield multiple order of magnitude improvements in real-world settings. We tried it on several of the success stories of Scalene (before the integration with LLMs); see https://github.com/plasma-umass/scalene/issues/58 - and found that it often automatically yielded the same or better optimizations - see https://github.com/plasma-umass/scalene/issues/554. (Full disclosure: I am one of the principal designers of Scalene.)
-
Ask HN: Are my HPC professors right? Is Python worthless compared to C?
Using Python for glue code and compiled native code (whether C or C++ or Rust or whatever) is a classic strategy.
Just profile your code with something like Scalene: https://github.com/plasma-umass/scalene
Alternatively, you can just write it in Julia.
- Scalene: A high-performance, high-precision CPU, GPU, memory profiler for Python
-
Using Rust to corrode insane Python run-times
I really want to know what the optimizations might have looked like had they used a profiler like scalene [0] to find where the unnecessary copying was happening.
[0] https://github.com/plasma-umass/scalene
- Memray – A Memory Profiler for Python
- Scalene: A high-performance CPU GPU and memory profiler for Python
- Scalene: A high-performance, CPU, GPU, and memory profiler for Python
-
How can I find out why my python is so slow?
Use this my fren: https://github.com/plasma-umass/scalene
-
Making Python 100x faster with less than 100 lines of Rust
You should take a look at Scalene - it's even better.
https://github.com/plasma-umass/scalene
-
Blog Post: Making Python 100x faster with less than 100 lines of Rust
I like seeing another Python profiler. The one I've been playing with is Scalene (GitHub). It does some fun things related to letting you see how much things are moving across the system Python memory boundary.
What are some alternatives?
When comparing coveragepy and scalene you can also consider the following projects:
toml - Python lib for TOML
pycallgraph
flit - Simplified packaging of Python modules
palanteer - Visual Python and C++ nanosecond profiler, logger, tests enabler
qtoml - Another Python TOML encoder/decoder
memray - Memray is a memory profiler for Python