Re: Very slow IDL vs Matlab (ascii file reading) [message #36888 is a reply to message #36887] |
Wed, 05 November 2003 04:22   |
Richard French
Messages: 173 Registered: December 2000
|
Senior Member |
|
|
On 11/5/03 7:13 AM, in article BBCE5389.FEA%rfrench@wellesley.edu, "Richard
G. French" <rfrench@wellesley.edu> wrote:
>
> I can reproduce this problem on MacOS with IDL6.0 - but it does not seem
> like a problem with 'width' to me, since that is related to writing the file
> - the problem is with reading a large single-line file in free format. It
> amazes me that it takes many minutes to read this file, and I think it is a
> definite bug. I'd suggest that you report this to RSI.
>
> Dick French
>
I tried to do an end-run by reading the file in as a string, and then using
READS to extract the required information from the string:
Openr,lun,/GET_LUN,'MyData.dat'
S=''
Readf,lun,s
Free_lun,lun
This gets executed almost instantaneously.
Help,s
S STRING = ' 999.00000 999.00000 999'...
Print,strlen(s)
5237760
Data=fltarr(660,496)
Reads,s,data
This takes forever, too. So, we've shown that the problem is not an I/O
problem, but one related to the actual parsing of the long string. What the
heck is happening during all of those CPU cycles? READS needs some serious
attention!
Dick French
|
|
|