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

Home » Public Forums » archive » Re: saving variables between calls to a procedure?
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: saving variables between calls to a procedure? [message #31587 is a reply to message #31586] Thu, 01 August 2002 11:04 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 31 Jul 2002 21:13:56 -0700, David Fanning wrote:

> JD Smith (jdsmith@as.arizona.edu) writes:
>
>> I just realized a factor of two increase in speed in a case of very
>> repetitive use of the a=[a,b] mechanism with vectors of length 10 or
>> less!
>
> Alright, I concede that this is probably not fast, although the vectors
> I use this technique with always have fewer than 100 elements, and I've
> always found it to be fast enough. (I just shake my head at the reports
> of people who have tried it with vectors of length 10 bazillion or so,
> and have been disappointed.)
>
> But I stand by my statement that it's neat. :-)

It is neat, very neat. I use it all the time, and rarely have to optimize
around it (here it was occuring hundreds of thousands of times...).
Growable arrays make life so much easier, obviating chunkier
implementations , like linked-lists, for almost all cases. Imagine how
much neater it would be, however, if not only could you grow your arrays
(on either end), but such operations would occur in O(1) time, independent
of the array size. This is an array feature already present in a variety
of other languages.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Image scrolling, displaying axes from outside the visible window
Next Topic: fft application?

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

Current Time: Thu Oct 09 21:53:15 PDT 2025

Total time taken to generate the page: 0.79737 seconds