#25491: django.utils.regex_helper.normalize should cache results locally
-------------------------------------+-------------------------------------
Reporter: atl-gmathews | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Utilities | Version: 1.8
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by knbk):
* status: new => closed
* needs_docs: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
`normalize()` is called exactly once for each pattern, in `_populate()`
(during the first call to `resolve()` or `reverse()`), and then cached in
the `RegexURLResolver`. I don't see any sense in adding an additional
layer of caching. Even if it provides a performance boost for patterns
that are reused multiple times, the difference will be minimal at best,
and it won't affect any requests after the `RegexURLResolver` has cached
the normalized patterns.
1:
https://github.com/django/django/blob/master/django/core/urlresolvers.py#L260
--
Ticket URL: <https://code.djangoproject.com/ticket/25491#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.195839e2d95b77c441c8fc42d4428dd6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.