#32778: Compile alphanumeric regex for CSRF middleware at module level.
-------------------------------------+-------------------------------------
Reporter: Abhyudai | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: CSRF | Version: 3.2
Severity: Normal | Resolution:
Keywords: middleware, csrf | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Abhyudai):
For what's it worth, the results for the `default_middleware` section when
run on my machine when comparing the patch branch to the main branch were:
{{{
Control: Django 4.0.dev20210524043148 (in git branch main)
Experiment: Django 4.0.dev20210524043148 (in git branch feat/optimize-
csrf)
Running 'default_middleware' benchmark ...
Min: -0.000020 -> -0.000111: 0.1772x faster
Avg: 0.000751 -> 0.000740: 1.0160x faster
Not significant
Stddev: 0.00529 -> 0.00522: 1.0144x smaller (N = 50)
}}}
Although, I'm not sure if this just tests the changes for the `Csrf` class
since the default middleware includes a lot more things.
--
Ticket URL: <https://code.djangoproject.com/ticket/32778#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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.4625c8aa50966a1efc02448b02257235%40djangoproject.com.