[SciPy-user] io.read_array slow

Travis Oliphant oliphant at ee.byu.edu
Thu Sep 15 12:59:40 EDT 2005


Christian Kristukat wrote:

>
> Hi,
> I noticed that io.read_array is really slow compared to a python 
> while/readline/split loop (about 5 times slower). I believe to 
> remember that at some time it was written in C but when I looked at 
> the source of scipy 0.3.2 it seems to be pure python. Is there a 
> evident reason why it must be that slow or are there maybe plans to 
> rewrite it in C?

It's slower because it does more, than that simple loop.    The old 
complexity-speed trade off.  No doubt there are optimizations that can 
be done.  If you find any, please let us know...

Notice that the new scipy core ndarray object has a builtin (simple) 
ascii file reader for each type.  This will be very fast for simple 
cases, but still is not perfect.

-Travis




More information about the SciPy-User mailing list