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

Home » Public Forums » archive » Re: intarr speed in structure
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: intarr speed in structure [message #10848 is a reply to message #10847] Mon, 16 February 1998 00:00 Go to previous message
Dr. G. Scott Lett is currently offline  Dr. G. Scott Lett
Messages: 14
Registered: February 1998
Junior Member
c.c.mclean@ed.ac.uk wrote:

> Hi,
>
> When I allocate an array, as part of a structure, it
> takes far longer to perform the operation than normal.
>
> ie. a) is much quicker than b) where:-
>
> a) array=intarr(x,y,z)
> b) array={volume:intarr(x,y,z)}
>
> if I use x=2048,y=240,z=5 a) takes 0.1s, b) takes 0.4s
> if I use x=2048,y=240,z=15 a) takes 0.4s,b) takes 2mins
>
> The same thing happens with IDL 5.03 under win95 (P200, 32MB)
> and with IDL 4 on an HP workstation.
>
> Can anybody explain why there is this difference!
>
> TIA
>
> Calum...
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading

In the case of the structure, IDL does the following:
Allocate enough memory for INTARR(x,y,z), and fill with zeroes.
Allocate enough memory for the structure, including enough to hold the
array.
Copy the (original) array into the structure.
Free the memory holding the (original) array.

I'm just guessing, but this looks like at least 3 times as much work as
simply
allocating memory for a single array, not counting for special hardware
and such.

Since 2 copies of the array exist temporarily, IDL uses (at least) twice
as much
memory to build the structure as the array. In your latter case,
intarr(2048,240,15)
requires about 14MB, so {volume:intarr(2048,240,15)} requires 28MB to
build.
Adding the memory for the IDL, the operating system, and any other memory
use,
you've probably exceeded the 32MB your system has, and you're using
virtual
memory, which is many times slower than RAM. This probably explains why
your second example is so much slower than the first.

--
========================
Dr. G. Scott Lett
slett@holisticmath.com
http://holisticmath.com/
========================
[Message index]
 
Read Message
Read Message
Previous Topic: pictures without borders, full screen pictures
Next Topic: Re: transparent routine using either readu or assoc for same array variable

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

Current Time: Sat Oct 11 10:25:30 PDT 2025

Total time taken to generate the page: 0.71832 seconds