Hi Ben,

On Fri, Aug 26, 2005 at 12:10:35PM +0100, [EMAIL PROTECTED] 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
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to