astropy: Some tests run much slower with coverage testing on Python 3 compared to Python 2
If I run just the astropy.units tests with:
python setup.py test -P units --coverage
On Python 2 it runs in:
============= 2739 passed, 15 skipped, 3 xfailed in 115.31 seconds =============
while on Python 3 it runs in:
============= 1658 passed, 3 xfailed in 335.95 seconds =============
Note that Python 3 runs fewer tests (because it doesn’t do the tests with unicode_literals) and even then it’s 3 times slower. I’m not sure if the bottleneck is in our functionality, or the coverage testing itself.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 63 (62 by maintainers)
Commits related to this issue
- Refactored test_roundtrip_ogip as part of researching Python 3 coverage performance in #4826 — committed to pllim/astropy by pllim 8 years ago
https://github.com/jrfonseca/gprof2dot
As this happens to be first hit on Google, and I just spent a lot of time chasing why coverage is slow, I’m going to leave a hint here for the future:
Check you have C extensions installed in your coverage package!
If you’re thinking of Canadian thanksgiving, we only have to wait about a month…
There is also https://jiffyclub.github.io/snakeviz/ if you want some other kind of visualization.
@pllim - these are parametrized tests, so it’s just the index of which exact test was being run.