[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slowness in function 'open'
From: |
Mark B. |
Subject: |
Re: Slowness in function 'open' |
Date: |
Thu, 21 Jun 2007 14:17:53 -0700 (PDT) |
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.
Re: Slowness in function 'open', Dmitri A. Sergatskov, 2007/06/21
- Re: Slowness in function 'open',
Mark B. <=
- Re: Slowness in function 'open', Muthiah Annamalai, 2007/06/21
- Re: Slowness in function 'open', Dmitri A. Sergatskov, 2007/06/21
- Re: Slowness in function 'open', John W. Eaton, 2007/06/21
- Re: Slowness in function 'open', Robert A. Macy, 2007/06/21
- Re: Slowness in function 'open', Mark B., 2007/06/22
- Message not available
- Re: Slowness in function 'open', Jordi Gutierrez Hermoso, 2007/06/22
- Re: Slowness in function 'open', John W. Eaton, 2007/06/22
Message not available
Re: Slowness in function 'open', Robert A. Macy, 2007/06/21
Re: Slowness in function 'open', Michael Creel, 2007/06/22