django / django-asv

Benchmarks for Django using asv
MIT License
40 stars 12 forks source link

Added system check benchmark #80

Closed adamchainz closed 7 months ago

adamchainz commented 7 months ago

As requested by @charettes on Django Ticket #35246 for covering my recent improvements to system check performance.

I ran the benchmark locally on recent commits and got this nice graph out:

Xnapper-2024-02-23-22 37 04

The precipitous drop is due to https://github.com/django/django/commit/28a3fbe0048883fdd5cefd6ffecb88e351121891 , which fixed O(n) execution of the URL custom error handler checks.

The benchmark environment doesn’t run every system check because it doesn’t install all contrib apps, notably the admin, and doesn’t use some features like GenericForeignKey. It also doesn’t have enough models, model inheritance, or relations to trigger some of the slownesses I’ve worked on. But I hope this benchmark is a good start.

charettes commented 7 months ago

Thanks a ton @adamchainz, I think it's fine if it doesn't cover everything after all most projects don't either.

adamchainz commented 7 months ago

Cheers @smithdc1 ! It seems there’s no way to trigger benchmarks on GHA for the previous commits, so the improvements so far won’t be recorded outside my screenshot above. But at least we have a defense against future regressions :)

smithdc1 commented 7 months ago

It seems there’s no way to trigger benchmarks on GHA for the previous commits

Yes, this is a bit of a shame, refs: https://github.com/django/django-asv/issues/47

But at least we have a defense against future regressions :)

Future regressions (even small ones) should be easier to track going forward. Something changed which means running them in GHA is now far more repeatable than before. https://django.github.io/django-asv/#req_resp_benchmarks.http_methods.benchmark.HttpMethods.time_get_method.

I wonder if the benchmark runner on django/django will also be more reliable now because of that 🤔