Changes between Initial Version and Version 1 of Ticket #35467
- Timestamp:
- May 20, 2024, 7:49:06 AM (7 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35467 – Description
initial v1 1 1 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. 2 2 3 I think most or all calls to `urlparse()` can be replaced with `urlsplit()` . This makemake a small but measurable performance difference in common paths, such as in `CsrfViewMiddleware` or the test `Client`.3 I 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`. 4 4 5 See more in this Anthony Sottile video: https://www.youtube.com/watch?v=ABJvdsIANds 5 See 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.