Changes between Initial Version and Version 1 of Ticket #35467


Ignore:
Timestamp:
May 20, 2024, 7:49:06 AM (4 months ago)
Author:
Adam Johnson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35467 – Description

    initial v1  
    11Many 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.
    22
    3 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`.
     3I think most or all calls to `urlparse()` can be replaced with `urlsplit()`, and similarly `urlunparse()` with `urlunsplit()`. This may make a small but measurable performance difference in common paths, such as in `CsrfViewMiddleware` or the test `Client`.
    44
    5 See more in this Anthony Sottile video: https://www.youtube.com/watch?v=ABJvdsIANds
     5See more in this Anthony Sottile video: https://www.youtube.com/watch?v=ABJvdsIANds , where he reports a 3% import time improvement on the Stripe project.
Back to Top