octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slowness in function 'open'


From: Daniel J Sebald
Subject: Re: Slowness in function 'open'
Date: Sat, 23 Jun 2007 12:12:02 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Daniel J Sebald wrote:

I tried a "save -binary testb.m A".  In that case "load testb.m"
seems to be very quick.  So, would it be feasible to create a
temporary binary file on the first pass?  It seems that all that is
needed is to move

 d = octave_read_double (tmp_stream);

inside get_lines_and_columns()'s loop along with saving to a binary output stream. Then perhaps an existing binary read method could be reused on the temp file.

Is it worth Jordi trying that approach?

I tossed a print command in between the two loop passes.  
get_lines_and_columns() takes roughly 1/3 of the time.  So octave_read_double() 
is a good part of the computations, and that is no surprise.  As John said, 
there is inf_nan_na and the fact there are a number of variations on a 
complex/real/imaginary number to consider.

If octave_read_double is where a lot of time is spent (should use a profiler to 
pinpoint), that would mean moving it to the first loop still won't cut overall 
time drastically.

What's left?  I don't know, if the file is very big, could first scan it in 
binary mode for any non-alphanumeric characters.  If there are none (i.e., no 
comments, no imaginary), then could use a less computationally intensive 
algorithm than octave_read_double() implements.

Go binary.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]