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

Home » Public Forums » archive » Re: simple vectorizing problem
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: simple vectorizing problem [message #62460 is a reply to message #62457] Tue, 09 September 2008 01:50 Go to previous messageGo to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
Looks like the memory allocation overhead associated with
vectorization is worse than looping:

vectorization 1 time: 5.0360808 s
vectorization 2 time: 4.8453941 s
looping itme: 4.0875931 s

The vectorization performances become comparitvely worse as the array
grows (both reform() and total() create temporary, large arrays).

chris

pro test

nimage = 1500
im = fltarr(512,512,nimage)

t0 = systime(/seconds)
mean=total(reform(im,512L*512L, nimage), 1)/(512.*512)
t1=systime(/seconds)

mean=total(total(im,1),1)/(512.*512.)

t2 = systime(/seconds)

for i=0, nimage-1, 1 do $
mean[i]=total(im[*,*,i])/(512.*512)

t3=systime(/seconds)

print, t1-t0
print, t2-t1
print, t3-t2

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Contour Issues... Help please
Next Topic: Is there a 32/64-bit save file

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

Current Time: Sat Oct 11 11:09:45 PDT 2025

Total time taken to generate the page: 1.19898 seconds