FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-159739: Avoid quadratic grouped-address parsing by jelle-openai · Pull Request #159990 · python/cpython · GitHub

Repository navigation

gh-159739: Avoid quadratic grouped-address parsing - #159990

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-email-addresslist-growth
Oct 21, 2026
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-email-addresslist-growth

Conversation

jelle-openai commented Oct 20, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

Avoid quadratic grouped-address parsing. email.utils.getaddresses() parses a group by repeatedly concatenating the accumulated address list with each newly parsed member. Each concatenation copies all prior entries, so a group with many members takes quadratic time and can consume excessive CPU. Extending the list in place avoids that repeated copying.

Backport to 3.15 and 3.14.

jelle-openai requested a review from a team as a code owner October 20, 2026 23:23

Copy link
Copy Markdown
Member

Not going to backport this as it's a performance improvement.

JelleZijlstra enabled auto-merge (squash) October 21, 2026 18:46
JelleZijlstra merged commit 080fc54 into python:main Oct 21, 2026
104 of 106 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL