Bob Belderbos: Profile First: A 10x Faster Django Test Suite (opens in new tab)
The Rust Platform Django test suite took 30 seconds to run. I had a hunch it was database-related. Of course I was wrong. I profiled it with cProfile and cut it from 30 to 3 seconds. Stop guessing, run the profiler The instinct on a slow test suite is to start making assumptions: too many fixtures, the database is slow, I should parallelize, it's the GIL. Every one of those is a real fix for some issues. The problem is you don't know until you measure. From : Sometimes it’s good to be lazy. B...
Read the original article