guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Growable arrays?


From: Daniel Hartwig
Subject: Re: Growable arrays?
Date: Mon, 11 Jun 2012 19:57:05 +0800

On 11 June 2012 18:38, David Kastrup <address@hidden> wrote:
> Well, considering the cost of dynvector-grow!, doing the growth in a
> loop rather then just the determination of the new size seems a bit
> expensive:

Only if you are repeatedly setting values at indices far beyond the
current capacity.  This does not occur in my usage patterns where
values are primarily inserted at the tail position (i.e. length),
which is amortized O(1) since grow! is geometric.

This is only an example, something which fits my needs well.  You are
free to adapt it or not to your particular needs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]