Huge performance gain compared to perl while loading a text file in a list ...!?

Martin Franklin mart.franklin at gmail.com
Sun Mar 13 15:55:39 EST 2005


Paul Rubin wrote:
> "Marc H." <coolroot at gmail.com> writes:
> 
>>I'm fairly new to python, and don't know much of its inner working so
>>I wonder if someone could explain to me why it is so much faster in
>>python to open a file and load it in a list/array ?
> 
> 
> My guess is readlines() in Python is separating on newlines while Perl
> is doing a regexp scan for the RS string (I forget what it's called in
> Perl).

I remember when it was the other way round ;-)

http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/fe217ae9723f7a38/23477243324bebc6?q=python+file+IO+speed#23477243324bebc6




More information about the Python-list mailing list