Enormous Input and Output Test

n00m n00m at narod.ru
Sat Oct 3 21:49:44 EDT 2009


On Oct 4, 2:29 am, Chris Rebert <c... at rebertia.com> wrote:

>
> That line is probably a Very Bad Idea (TM) as it reads the *entire*
> enormous file into memory *at once*. It would probably be much better
> to iterate over the file, thus only reading one individual line at a
> time. I'm betting the massive malloc()ing involved with .readlines()
> is a large part of the slowness.

Certainly not.
The culprit is line "a = map(noo, a)".
Without it execution time = 2.59s (I've just checked it).



More information about the Python-list mailing list