django-test-performance
Installation
SKILL.md
Django Test Performance
Use this as the orchestration skill for speeding up a Django test suite. Do not start by changing settings blindly; first measure the suite and then pick the smallest safe optimization with a repeatable verification command.
Core Workflow
-
Establish a baseline.
- Run the same command developers or CI use.
- Capture wall-clock time, runner, settings module, database backend, worker count, and branch.
- If the cause is unclear, use
django-test-profilingbefore changing behavior.
-
Classify the dominant cost.
- Startup/import/discovery: reduce collection scope and expensive app initialization.
- Database creation/migrations: reuse DB locally, squash migration history, or improve database storage.
- Per-test setup: reduce fixture data, use factories, and use
setUpTestData. - External backends: replace file storage, cache, task queues, and instrumentation with test-safe backends.
- Long tail of tests: parallelize after isolation checks.