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

Home » Public Forums » archive » READS, input, struct vs. READS, input, var1,var2, etc.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
READS, input, struct vs. READS, input, var1,var2, etc. [message #50004] Thu, 07 September 2006 14:05
Pete Warner is currently offline  Pete Warner
Messages: 14
Registered: July 2006
Junior Member
I've been reading large ascii text files into IDL and discovered a huge
difference in run time when using READS and structures versus READS and
other variables. What is going on?

The slow way:
struct = {teststruct, var1:0, var2:0.0, str1:''}
reads, linefromfile, struct, format='(I2, F10.3, A0)'

Somehow way faster:
var1=0
var2=0.0
str1=''
reads, linefromfile, var1, var2, str1, format='(I2, F10.3, A0)'
struct = {teststruct, var1:var1, var2:var2, str1:str1}

Could someone explain why the first way is so slow? It is quite
noticible in my program, running in 2.7 seconds the first way and
0.125s the second. The actual lines I'm reading are much longer than
the examples above. Anything that could help me avoid similar problems
would be great.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Family Therapy!?
Next Topic: Re: ascii_template advanced

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

Current Time: Wed Oct 08 15:35:04 PDT 2025

Total time taken to generate the page: 0.21145 seconds