#35467: Prefer urlsplit() over urlparse()
------------------------------------------------+------------------------
               Reporter:  Adam Johnson          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Utilities             |        Version:  dev
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 Many places in Django use
 
[`urlparse()`](https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse),
 which supports the rarely-used “path parameter” syntax (not to be confused
 with query parameters). The `urlsplit()` function is similar but does not
 parse such path parameters, which makes it a bit faster.

 I think most or all calls to `urlparse()` can be replaced with
 `urlsplit()`. This make make a small but measurable performance difference
 in common paths, such as in `CsrfViewMiddleware` or the test `Client`.

 See more in this Anthony Sottile video:
 https://www.youtube.com/watch?v=ABJvdsIANds
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35467>
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/0107018f960b4f56-60cddaba-8d3a-4807-b225-0ddb0194587f-000000%40eu-central-1.amazonses.com.

Reply via email to