django-fastmig, makes `migrate` several times faster

Released an experimental package making migrate much faster in large projects. Especially useful if you do pytest -create-db frequently, or run reverse migration testing in CI. Django’s own test suite passes with fastmig. Also tested on a 8 year old project with multiple revisions and migration squashes over the years.

Made it to speed up my own testing being bottlenecked by -create-db.
There’s a link in readme related to forum posts which discusses slow migrations.

If you give it a try (and have many migrations) feel free to share if you see any big performance improvements, or small :wink:

3 Likes

Thanks for the work here Viktor, and linking back to Very slow migrations with large numbers of tables .

I think this is a valuable step forward on improving the slow migrations problem. You’ve described things well in your README, showing a clear understanding of bottlenecks.

Do you think you’ve found anything that could be applied to Django as an orthogonal step to @charettes 's model state ticket ?

2 Likes

Shaving time off pytest --create-db on old codebases with huge migration histories is a massive win for CI builds.

Running this on an 8-year-old project while passing Django’s test suite is a huge green flag. How are you bypassing the usual migration tree overhead under the hood without altering the generated SQL?

Definitely spinning this up in dev today to test the speedup. Awesome work!