Array append performance

Robert Jacques sandford at jhu.edu
Mon Aug 25 08:03:00 PDT 2008


On Mon, 25 Aug 2008 01:41:51 -0400, Lionello Lunesu  
<lionello at lunesu.remove.com> wrote:

> BTW, the capacity look-up was indeed using the cached values. Meaning,  
> it's not "capacity" we should be focussing on, but the general append  
> code. However, if you were to append to two different arrays in a  
> similar loop, the performance would be terrible, since each array would  
> overwrite the cache with its own ptr/size, resulting in the slow O(m+n)  
> for each capacity look-up.

Such as in this case: http://en.wikipedia.org/wiki/D_language#Example_2



More information about the Digitalmars-d mailing list