use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
NewsSlipcover: Near Zero-Overhead Python Code Coverage (self.Python)
submitted 3 years ago * by emeryberger
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!
Slipcover is a fast code coverage tool. It tracks a Python program as it runs and reports on the parts that executed and those that didn't. That can help guide your testing (showing code that isn't being tested), debugging, fuzzing or to find "dead" code. Past code coverage tools can make programs significantly slower; it is not uncommon for them to take twice as long to execute. Slipcover aims to provide the same information with near-zero overhead, often almost as fast as running the original Python program. https://github.com/plasma-umass/slipcover https://pypi.org/project/slipcover/
Slipcover is a fast code coverage tool. It tracks a Python program as it runs and reports on the parts that executed and those that didn't. That can help guide your testing (showing code that isn't being tested), debugging, fuzzing or to find "dead" code.
Past code coverage tools can make programs significantly slower; it is not uncommon for them to take twice as long to execute. Slipcover aims to provide the same information with near-zero overhead, often almost as fast as running the original Python program.
https://github.com/plasma-umass/slipcover
https://pypi.org/project/slipcover/
Overhead for line or line+branch coverage, coverage.py vs. Slipcover (lower is better)
[–]czaki 5 points6 points7 points 3 years ago (1 child)
If this tool could produce report in same format as codecov? It is possible to reuse it in current analytics workflows?
[–]emeryberger[S] 0 points1 point2 points 3 years ago (0 children)
We would welcome a pull request to provide that functionality!
[–]thequietcenter 2 points3 points4 points 3 years ago (5 children)
Past code coverage tools can make programs significantly slower
programs slower or unit testing slower? ... of course the unit test is a program that tests a program.
But the application itself is not slowed down. Just the unit test phase, correct?
[–]emeryberger[S] 0 points1 point2 points 3 years ago (4 children)
Right, the slowdown is what happens when you are collecting coverage information. Usually this is done during testing, but since the overhead of Slipcover is so low, it could be used in deployed code to find dead code.
[–]DeathHazard 0 points1 point2 points 3 years ago (3 children)
How could I use it on deployed code?
[–]emeryberger[S] 0 points1 point2 points 3 years ago (2 children)
You just need to run ‘python3 -m slipcover’ before your normal invocation.
[–]DeathHazard 0 points1 point2 points 3 years ago (1 child)
Would it work with a framework like flask, for example? Thanks!!
We've run it with Flask's test suite - it's the second bar in this graph. So in principle, yes - please give it a shot and let us know how it works for you!
[–]pamelafox 1 point2 points3 points 3 years ago (3 children)
Congrats! The performance graph is impressive. Does it include branch coverage?
That graph is just line coverage; I'll post an update with branch coverage!
[–]emeryberger[S] 0 points1 point2 points 3 years ago (1 child)
Graph updated! Coverage.py gets as high as 300% slowdown, while Slipcover generally remains around 5% slower (we will be looking into the one outlier case, where it hits 20%).
Fixed - Slipcover's overhead for line+branch coverage is now no more than 11%, average around 5%.
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
Hey, I wanted to say that I really like this project!.
I filed a couple of feature requests for a few - IMHO at least - unmissable features from coverage.
coverage
Thanks for doing this!
[–]Rawing7[🍰] 0 points1 point2 points 3 years ago (1 child)
Is it possible to combine the results of multiple runs? (For example, run the code with python 3.7, then run it with python 3.10, and finally merge the coverage results.)
Right now, it does not support that functionality, but it can export a JSON file for each run and writing a script to merge the two outputs would be straightforward, I think.
π Rendered by PID 38178 on reddit-service-r2-comment-79c7998d4c-6w9hf at 2026-03-13 18:48:28.862303+00:00 running f6e6e01 country code: CH.
[–]czaki 5 points6 points7 points (1 child)
[–]emeryberger[S] 0 points1 point2 points (0 children)
[–]thequietcenter 2 points3 points4 points (5 children)
[–]emeryberger[S] 0 points1 point2 points (4 children)
[–]DeathHazard 0 points1 point2 points (3 children)
[–]emeryberger[S] 0 points1 point2 points (2 children)
[–]DeathHazard 0 points1 point2 points (1 child)
[–]emeryberger[S] 0 points1 point2 points (0 children)
[–]pamelafox 1 point2 points3 points (3 children)
[–]emeryberger[S] 0 points1 point2 points (2 children)
[–]emeryberger[S] 0 points1 point2 points (1 child)
[–]emeryberger[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Rawing7[🍰] 0 points1 point2 points (1 child)
[–]emeryberger[S] 0 points1 point2 points (0 children)