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

Home » Public Forums » archive » Re: Cyclic array interfaces
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: Cyclic array interfaces [message #40187] Tue, 13 July 2004 19:53 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Cedric wrote:
> Mark Hadfield <m.hadfield@niwa.co.nz> wrote in message news:<cd1no6$q54$1@newsreader.mailgate.org>...
>
>> Analysis be dammed, I counted them! And got a result that disagrees with
>> your analysis:
>
>
> :) I should have remembered that programmers are always wrong when
> they don't use a profiler!
>
> I'm still surprised by your result, though. Perhaps IDL knows that
> findgen(n) is a temporary in the first case (thus assigning its
> address directly to a) and not in the second case.

The result below supports this.


> I don't have access
> to IDL now, but I would try
>
> n = 10000000 & a = fltarr(n) & b = findgen(n) & t0 = systime(1) & a =
> b & t1 = systime(1) & a[0] = b & t2 = systime(1) & print, t1-t0, t2-t1

0.14100003 0.093999863

The results are pretty consistent, by the way.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)

*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
*** More included text than new text. Blah blah blah ***
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Collection of different size arrays?
Next Topic: IDL FFT Source Code

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

Current Time: Fri Oct 10 15:54:21 PDT 2025

Total time taken to generate the page: 0.47834 seconds