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

gh-119105: difflib.py Differ.compare is too slow [for degenerate cases] by tim-one · Pull Request #119376 · python/cpython · GitHub

Repository navigation

gh-119105: difflib.py Differ.compare is too slow [for degenerate cases] - #119376

Merged
tim-one merged 5 commits into
python:mainfrom
tim-one:differ
May 22, 2024
Merged

tim-one merged 5 commits into
python:mainfrom
tim-one:differ

Conversation

tim-one commented May 22, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

A different approach, tracking all ascending index pairs achieving the best ratio. None of them needs recursion then. And, more importantly, it restores difflib's general "top to bottom" ordering of matches.

tim-one merged commit 07df93d into python:main May 22, 2024
tim-one deleted the differ branch May 22, 2024 23:25
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…e cases] (python#119376)

Track all pairs achieving the best ratio in Differ(). This repairs the "very deep recursion and cubic time" bad cases in a way that preserves previous output.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

difflib.py Differ.compare is too slow [for degenerate cases]

1 participant


Back | FazBrowse Home | New Git URL