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

Home » Public Forums » archive » Memory management when concatenating arrays
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: Memory management when concatenating arrays [message #92192 is a reply to message #92189] Wed, 28 October 2015 07:54 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Wednesday, 28 October 2015 15:44:05 UTC+1, Yngvar Larsen wrote:
> I ran the following script:

Bug fix for the last two cases follows. Still same conclusion, but

print, '**************'
print, 'Preallocation with zero initialization:'
tic
all_data = fltarr(nx,ny,nt*10)
for ii=0, N-1 do all_data[0,0,ii*nt] = data
toc

print, '**************'
print, 'Preallocation without zero initialization'
tic
all_data = fltarr(nx,ny,nt*10, /NOZERO)
for ii=0, N-1 do all_data[0,0,ii*nt] = data
toc


Concatenation:
Process took 6.524 seconds
**************
Preallocation with zero initialization:
Process took 1.506 seconds
**************
Preallocation without zero initialization
Process took 1.244 seconds

I also ran with double precision arrays, and got this:

Concatenation:
Process took 21.428 seconds
**************
Preallocation with zero initialization:
Process took 5.366 seconds
**************
Preallocation without zero initialization
Process took 2.953 seconds



--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Display of hyperspectral image in the window of a specified size
Next Topic: interpolation

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

Current Time: Wed Oct 08 11:43:06 PDT 2025

Total time taken to generate the page: 0.00410 seconds