Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Profiles slow Django test suites with shell timing, Django's runner, pytest-django, py-spy, and cProfile to rank bottlenecks.
Use this skill ↓82% 91%+9 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 18 of 22 without it.
3 of 3 safety checks passed
Not used yet
Use these commands as starting points and adapt them to the project's runner, package manager, and CI environment.
| Goal | Command |
|---|---|
| Full Django suite wall-clock time | time python manage.py test |
| Django DB setup/teardown timing | python manage.py test --timing |
| Full pytest suite wall-clock time | time pytest |
| Slowest pytest phases | pytest --durations 20 |
| PowerShell timing | Measure-Command { python manage.py test } |
Repeat short runs several times. For long suites, a single CI baseline may be enough to prioritize first-pass work, but note that it is a noisy measurement.
Use py-spy for a low-overhead overview of where a running suite spends time.
python -m pip install py-spy
sudo py-spy record -o profile.svg --subprocesses -- python manage.py test
sudo py-spy record --format speedscope -o profile.speedscope --subprocesses -- python manage.py test
Use --subprocesses for Django parallel tests or tools that fork worker processes. Add --idle only when sleeping or idle time is itself part of the diagnosis.
Use cProfile when sampling is too coarse or you need exhaustive Python call accounting.
python -m cProfile -s cumtime manage.py test
python -m cProfile -m pytest
python -m cProfile -o profile.prof manage.py test
Read cumulative time first to find expensive call trees. Then inspect total time to find functions that are expensive by themselves rather than through their callees.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.