django-test-profiling

Installation
SKILL.md

Django Test Profiling

Use this skill before changing a Django test suite for speed. Measurement decides which optimization is worth doing; otherwise it is easy to spend time on harmless settings while the real cost sits in startup, database setup, fixture construction, or a small set of slow tests.

Measurement Workflow

  1. Capture a full wall-clock baseline.

    • Prefer shell timing because it includes Python startup, Django import time, test discovery, database setup, and teardown.
    • Record the exact command, environment, and repeat count.
  2. Separate framework phases when possible.

    • For Django's runner, use --timing to see database setup and teardown.
    • For pytest, compare shell timing with pytest --durations.
  3. Find the slowest tests.

    • For pytest-django, start with pytest --durations 20.
    • For Django's runner, use an existing slow-test plugin or a small custom runner only when the project does not already have one.
Installs
45
Repository
lvtd-llc/skills
GitHub Stars
1
First Seen
Jun 21, 2026
django-test-profiling — lvtd-llc/skills