#36520: Performance Regression in parse_header_params
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: Natalia
| Bidart
Type: Bug | Status: assigned
Component: HTTP handling | Version: dev
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):
Quoting [https://discuss.python.org/t/performance-regression-from-using-
email-message-message-get-params-as-replacement-of-cgi-parse-header-
following-pep-594/99963/6 Brett Cannon on the python forum]:
> You can open an issue, but I would advise you keep your backport of
cgi.parse_header() if it gives you the performance you’re after.
Agree with comment:27 that there's nothing wrong with keeping a backport,
but I do start to doubt whether we should "be after" anything here at all.
2100 nanoseconds for clearer & stdlib Python seems worth paying for, even
in every request. DRF is calling this function oodles of times without a
care. We could probably shave the 2100 nanoseconds down by using a module-
level `Message` constant, given that we only get and set one header type.
But I agree with Natalia and comment:13 that a revert makes sense at
present given the time pressure.
----
> Because any form submission will probably hit the slow path, as could
many other clients, short-circuiting probably isn't the way to go.
Fair, but if it helps DRF at least perform no worse (given some calls
improve and others degrade), I think it's still viable.
--
Ticket URL: <https://code.djangoproject.com/ticket/36520#comment:29>
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 visit
https://groups.google.com/d/msgid/django-updates/010701994e9ef892-5a9326ac-1681-4a9b-92ae-21ffa0a04f6d-000000%40eu-central-1.amazonses.com.