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

Home » Public Forums » archive » Lots of files
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: Lots of files [message #53133 is a reply to message #53058] Mon, 19 March 2007 07:27 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lasse Clausen writes:

> However, I still do not
> know why
>
>
> openr, fin, filename, /get_lun
> for i=0L, lines-1L do begin
> point_lun, fin, i*1440L
> readf, fin, line, format='(A1440)'
> endwhile
>
> (note that all the string processing and where is taken out) takes
> about 30 seconds. Well, I supsect the format code, there isn't much
> else to supsect. Can anybody explain to me why the above solution is
> so slow?

I'm guessing here, something I never do in a newsgroup
post. ;-)

I'd guess the biggest problem is the READF, rather
than a READU. I think if you took out the POINT_LUN
and made the READF into a READU this would turn out
to be reasonably fast, too, even with a FORMAT keyword.

I think when you do a READF, you *always* read to the
end of the "line", which in this case is the end of the
file. Then, you have to re-position the file pointer for
the next read, etc. I think that's why it is so slow.
There is a lot of churning going on. You could test this
by checking the file pointer position at the end of the
READF. (Use POINT_LUN, -fin, position & Print, position.)
I'd be curious to know. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: replicating arrays
Next Topic: Re: Question about selecting images from Draw Widgets

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

Current Time: Sat Oct 11 06:57:16 PDT 2025

Total time taken to generate the page: 1.60436 seconds