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

Home » Public Forums » archive » Re: Arrays suck. Loops rock.
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: Arrays suck. Loops rock. [message #42948] Tue, 08 March 2005 11:51 Go to previous message
Y.T. is currently offline  Y.T.
Messages: 25
Registered: December 2004
Junior Member
> IDL> test_loop,findgen(300,300,10),findgen(10,20),disps,nloops=0
> took 1.1159251 sec
> IDL> test_loop,findgen(300,300,10),findgen(10,20),disps,nloops=1
> took 0.96256900 sec
> IDL> test_loop,findgen(300,300,10),findgen(10,20),disps,nloops=2
> took 2.0543392 sec
> IDL> test_loop,findgen(300,300,10),findgen(10,20),disps,nloops=4
> took 27.267108 sec
>


I'd like to add to this that I sure hope you guys didn't just run each
call once -- for then the results you get are utterly arbitrary. At the
level of a sizable fraction of a second the OS can throw stuff at you
for no better reason than that it is tuesday. On your first call, IDL
has to allocate a lot of memory, for example, which it may or may not
free up and thus it may or may not be faster on the second call. Any
memory allocation may or may not proceed swiftly depending on how much
cleanup the OS has to do before it can hand IDL the requisite amount of
memory. And so forth.

Thus for any kind of timing comparisons you'll always want to re-run
the routine in question at least a couple times (ideally something like
1000 times from a loop and then compute the average). Otherwise you're
measuring OS latency because of a big TCP packet that happened to hit
your ethernet port just that moment (or similar things) rather than the
actual speed of the algorithm.



(I honestly fail to understand the provided example and am not at all
sure that the two "rebins" are necessary. You are aware that 'rebin'
performs interpolations, right?)


cordially


Y.T.

--
Remove YourClothes before you email me.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Deleting structures (does this work, or am I missing something?)
Next Topic: Weird Runtime Problem

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

Current Time: Fri Oct 10 00:43:21 PDT 2025

Total time taken to generate the page: 0.24238 seconds