#35229: Prevent repeated checks of custom error handler URLs
------------------------------------------------+--------------------------
               Reporter:  Adam Johnson          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  assigned
              Component:  Core (System checks)  |        Version:  dev
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  1
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+--------------------------
 In #29642 I added a system check for custom error handler URLs.

 I looked at a profile for running the system checks on a project and found
 this check function ran hundreds of times rather than once, totalling 1/4
 of the time to run checks. The multiple runs occur because the check is
 defined on `URLResolver`, of which exist in a tree structure. Moving the
 check from `URLResolver` to a function in `django.core.checks.urls`
 ensures it runs only once.

 In the profiled project with 279 URLs, this takes the checks from ~24ms to
 ~21ms, a ~13% saving.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35229>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018dbc1490ce-080f122f-e123-4938-a559-9f09febc66d0-000000%40eu-central-1.amazonses.com.

Reply via email to