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

Home » Public Forums » archive » Re: Concatenating arrays - speed issues?
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: Concatenating arrays - speed issues? [message #76471 is a reply to message #76470] Wed, 08 June 2011 04:55 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Rob <rjp23@le.ac.uk> wrote:
> On Jun 7, 5:42 pm, Craig Markwardt <craig.markwa...@gmail.com> wrote:
>> What you are doing is the "IDL way" in the sense that it's a natural
>> use of the concatenation feature of the language.
>>
>> But as you noticed, the performance degrades for lots of append
>> operations.
>>
>> The next best way is to grow the array in chunks, and then fill in the
>> chunks with available data. This forces you to keep track of the
>> number of used elements in the array, separate from the array size.
>> Once you fill the available chunk, only then do you add another
>> chunk.
>>
>> This doesn't really get rid of the problem you noticed, but it does
>> reduce the problem significantly. So, if each chunk has 1000
>> elements, then the performance degradation is 1000x less. Then you
>> can start to get fancy by growing the array with variable sized
>> chunks.
>>
>> Craig
>
>
> That might actually be quite a nice solution, it just means keeping
> track with a few more counters.
>
> I'll have a play and see how it goes :-)
>
> Cheers

My classes do the accounting for this technique for you.

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: openr or openw with COMPRESS flag broken for large data files
Next Topic: labeling is not visible in postscript output

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

Current Time: Fri Oct 10 14:00:09 PDT 2025

Total time taken to generate the page: 0.47945 seconds