📝 Improve the performance of `_run_checks` and `_run_async_checks` (#1454)
Currently we have two functions with logic on how to run endpoint checks:
django-modern-rest/dmr/endpoint.py
Lines 417 to 425 in 405ba9b
and then we check inside each call if this call was even needed:
django-modern-rest/dmr/endpoint.py
Lines 427 to 432 in 405ba9b
CALL is not a cheap operation in Python, so I propose a different design.We should check if the call is needed before the call itself. And only call parts that are actually required.
This is especially important for the async code:
django-modern-rest/dmr/endpoint.py
Lines 460 to 471 in 405ba9b
Where we are awaiting 4 indeprendent coroutines.
We should not, if possible.
#good_first_issue #help_wanted #performance #opensource_september #django_modern_rest
sent via relator