classification
Title: tokenize.py improvements
Type: performance Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Indy, rhettinger
Priority: normal Keywords: patch

Created on 2008-06-11 13:10 by Indy, last changed 2008-06-17 13:56 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
tokenize.py.patch Indy, 2008-06-11 13:10 The patch in "diff -urN" format.
Messages (3)
msg67965 - (view) Author: Aristotelis Mikropoulos (Indy) Date: 2008-06-11 13:10
Various tokenize.py performance boosts and code clarifications.
msg68320 - (view) Author: Aristotelis Mikropoulos (Indy) Date: 2008-06-17 13:07
So, will this patch be applied?
msg68325 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-06-17 13:56
Sorry, I don't see any value in this kind of patch.

The line "contline = += line"  is broken. The "+=" transformations and 
else-clause eliminations trivially re-arrange code without any real 
savings.  The "while 1" to "while True" transformation should not be 
done in Py2.x because the latter is much slower ("while True" requires 
loading a global variable and a test; in contrast, "while 1" is 
optimized to an unconditional jump.
History
Date User Action Args
2008-06-17 13:56:34rhettingersetstatus: open -> closed
resolution: rejected
messages: + msg68325
nosy: + rhettinger
2008-06-17 13:07:36Indysetmessages: + msg68320
2008-06-11 13:10:45Indycreate