]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-119105: difflib: improve recursion for degenerate cases (#119131)
authorpulkin <gpulkin@gmail.com>
Sun, 19 May 2024 21:46:37 +0000 (23:46 +0200)
committerGitHub <noreply@github.com>
Sun, 19 May 2024 21:46:37 +0000 (16:46 -0500)
commit0abf997e75bd3a8b76d920d33cc64d5e6c2d380f
tree3c53ca1a45a4706d853c0d5f56e59a208fe1408c
parent3c28510b984392b8dac87a17dfc5887366d5c4ab
gh-119105: difflib: improve recursion for degenerate cases (#119131)

Code from https://github.com/pulkin, in PR
https://github.com/python/cpython/pull/119131

Greatly speeds `Differ` when there are many identically scoring pairs, by splitting the recursion near the inputs' midpoints instead of degenerating (as now) into just peeling off the first two lines.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Lib/difflib.py
Misc/NEWS.d/next/Library/2024-05-19-12-25-36.gh-issue-119105.VcR4ig.rst [new file with mode: 0644]