Improve performance of http.cookiejar.join_header_words
#128982
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
Currently, we use
if not re.search(r"^\w+$", v):
. This can be replaced byif not v.isalnum() and '_' not in v
. Benchmarks are as follows:It doesn't help having a compiled regex by the way.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
http.cookiejar.join_header_words
for an efficient alternative #128983The text was updated successfully, but these errors were encountered: