
Author: cfbolz Date: Fri Aug 26 13:07:00 2005 New Revision: 16598
Added: pypy/dist/lib-python/modified-2.4.1/linecache.py - copied, changed from r16593,
Wasn't this discussed on Python-Dev recently? I think CPython has the same problem. Cheers, Ben pypy-svn-bounces@codespeak.net wrote on 26/08/2005 12:07:00: pypy/dist/lib-python/2.4.1/linecache.py
Log: For now, use Richard's idea to optimize linecache.py until we figure out why readlines() is so slow in 'U'-mode files.
_______________________________________________ pypy-svn mailing list pypy-svn@codespeak.net http://codespeak.net/mailman/listinfo/pypy-svn

Hi Ben, On Fri, Aug 26, 2005 at 12:10:35PM +0100, Ben.Young@risk.sungard.com wrote:
Wasn't this discussed on Python-Dev recently? I think CPython has the same problem.
pypy/dist/lib-python/2.4.1/linecache.py
Log: For now, use Richard's idea to optimize linecache.py until we figure out why readlines() is so slow in 'U'-mode files.
I can't tell. I would be surprized if the problem is exactly the same: it seems that (at that point) if we replace f.readlines() with f.read().splitlines(True), things are seriously faster. This points to a problem in our lib/_sio.py which is exposed by our lib/_file.py. Meanwhile, Richard removed this linecache.py hack after he figured out one thing that killed performance: string slicing. Its implementation in stringobject.py was very old and completely broken performance-wise. A bientot, Armin
participants (2)
-
Armin Rigo
-
Ben.Young@risk.sungard.com