Re: Merits of different ways of 'extending' arrays [message #85729 is a reply to message #85728] |
Thu, 29 August 2013 09:59   |
Andy Sayer
Messages: 127 Registered: February 2009
|
Senior Member |
|
|
Thanks; happily, this was a simple recode to make. :)
Andy
On Thursday, August 29, 2013 12:29:43 PM UTC-4, David Fanning wrote:
> AMS writes:
>
>
>
>> This has the drawback that I have to know in advance the maximum number of data points I could have (but I can set max_points to some arbitrary high number to be safe). Does anyone know whether any one method is better/less memory-intensive than the other, when it comes to largeish data volumes (tens of millions of points)? I only have a few percent of the final data so far, so am interested in the likely merits of each method. Google didn't help but perhaps I was using
>
> the wrong search keywords.
>
>
>
> You are MUCH better off to allocate memory in large chucks and then trim
>
> or add to your arrays (in more large chunks) as necessary. This will
>
> keep you from fragmenting your memory space, which is the single biggest
>
> problem when working with large arrays.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|