comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Very slow IDL vs Matlab (ascii file reading)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Very slow IDL vs Matlab (ascii file reading) [message #36897 is a reply to message #36896] Tue, 04 November 2003 14:13 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Marcin Jakubowski wrote:

> Hi all,
> I've tried to read an ASCII file, which is composed of one very long row
> (660*496) double precision numbers, each of them delimited with
> tabulator. In Matlab 6.5 I am using small program
>
> =============================================
> fid = fopen('Mydata.dat');
> data = fscanf(fid,'%g',[660,496]);
> fclose(fid)
> =============================================
>
> and it takes about one second to read the file. If I try to do similar
> in IDL 6.0
>
> =============================================
> data = FltArr(660, 496)
> OpenR, lun, 'Mydata.dat', /Get_Lun
> ReadF, lun, data
> Free_Lun, lun
> =============================================
>
> then it takes about 20 minutes (!!!) to read the same file. What causes
> the problem? Unfortunately I need to use the IDL as it is a part of huge
> code written in IDL. Is it any chance to shorten that time?
>
>
> Many thanks in advance,
> Marcin
>
> P.s. I've performed checks on PC and Linux machines and the outcomes are
> similar.

Dear Marcin,

two things
1) you are speaking from double precision but you have defined float only
2) there must be a local problem on your machines.
How much memory is free after the first reading.
You could use help,/memory to get this information. The thing you
described usally happens if swapping is necessary or someone else uses
100 % CPU time. I tried today during the lessons a similiar example
without a problem.

regards

Reimar

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to solve a homogeneous system(Ax=0) with a gauss elimination method that x is not zero.
Next Topic: Simple seismic ray tracing code?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:48:34 PDT 2025

Total time taken to generate the page: 0.00424 seconds