taobojlen / django-zeal

Detect N+1s in your Django app.
MIT License
90 stars 1 forks source link

Performance issues #24

Closed serl closed 1 month ago

serl commented 2 months ago

We have a big project with lots of tests (~5000), note that an important part of them are good old unit tests, and don't touch the HTTP stack. The whole suite takes ~5 minutes (of course we have pytest-xdist and stuff).

I enabled django-zeal only with the middleware, and now the test suite takes about twice the time: ~10 minutes (and finds a bunch of violations, but that's definitely my problem).

Let me know if you have any suggestion on how I can help to improve the situation, and/or if you know already about some low-hanging improvements I can try to make.

taobojlen commented 1 month ago

Thanks for the report @serl ! I just released django-zeal 1.4.1 which includes a performance fix -- hopefully your test suite should go back to taking ~5 minutes once you update. Let me know how it goes!

serl commented 1 month ago

That was totally it! Thanks a lot 🚀