[issue19365] Quadratic complexity in the parsing of re replacement string

2013-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Antoine for your review. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue19365] Quadratic complexity in the parsing of re replacement string

2013-10-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset b322047fec55 by Serhiy Storchaka in branch 'default': Issue #19365: Optimized the parsing of long replacement string in re.sub*() http://hg.python.org/cpython/rev/b322047fec55 -- nosy: +python-dev ___ Pyt

[issue19365] Quadratic complexity in the parsing of re replacement string

2013-10-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Normally optimizations should only land in the default branch, unless it's catastrophic regression. -- nosy: +tim.peters versions: -Python 2.7, Python 3.3 ___ Python tracker

[issue19365] Quadratic complexity in the parsing of re replacement string

2013-10-23 Thread Christian Heimes
Christian Heimes added the comment: LTGM except for Python 2.7. I think we should slowly stop applying optimizations and other non-critical fixes to 2.7. -- nosy: +christian.heimes ___ Python tracker _

[issue19365] Quadratic complexity in the parsing of re replacement string

2013-10-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: sre_parse.parse_template uses string concatenation to accumulate characters. def literal(literal, p=p, pappend=a): if p and p[-1][0] is LITERAL: p[-1] = LITERAL, p[-1][1] + literal else: pappend((LITERAL, literal))