|
From: | Muthiah Annamalai |
Subject: | Re: Slowness in function 'open' |
Date: | Thu, 21 Jun 2007 16:27:29 -0500 |
Dmitri A. Sergatskov wrote:
>
> You can try low-level i/o functions.
> Assuming your big file is many lines long with 3 columns of data
>
> fh = fopen('mybigfile");
> a=fscanf(fh, "%f %f %f", [3, inf]);
>
> will be perhaps the fastest way to read it in octave.
>
Thanks Dmitri, this improved the performance although not that much. These
are my new results:
GNU Octave, version 2.9.12 (configured for "i686-pc-msdosmsvc")
***************************************************
%Before the first run I flushed the cache of the location where 'mybigfile'
resides
octave.exe:1> tic; fh = fopen('mybigfile'); values=fscanf(fh, '%d', [1,
inf]); toc;
Elapsed time is 53.413849 seconds.
%Before the next run I flushed the cache of the location where 'mybigfile'
resides
octave.exe:2> tic; fh = fopen('mybigfile'); values=fscanf(fh, '%d', [1,
inf]); toc;
Elapsed time is 53.468552 seconds.
***************************************************
Matlab version 7.3.0.267 (R2006b)
***************************************************
%Before the first run I flushed the cache of the location where 'mybigfile'
resides
>> tic; fh = fopen('mybigfile'); values=fscanf(fh, '%d', [1, inf]); toc;
Elapsed time is 7.740050 seconds.
%Before the next run I flushed the cache of the location where 'mybigfile'
resides
>> tic; fh = fopen('mybigfile'); values=fscanf(fh, '%d', [1, inf]); toc;
Elapsed time is 7.708370 seconds.
***************************************************
In this case although Octave was 1.84 times than using its 'load' function
(Matlab was 3.60 faster than its 'load' function), Octave is still a bit
slow.
Does anybody else know how to improve these times?
Thanks
--
View this message in context: http://www.nabble.com/Slowness-in-function-%27open%27-tf3960902.html#a11241801
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |