why does array appending add a page size instead of doubling ?

Chris Cain clcain at uncg.edu
Sat Feb 2 22:48:57 PST 2013


Okay, I've got a question for you Ali... why is it that sometimes 
as Elements increased, there were a _drop_ of allocations?

So, these in particular:

On Sunday, 3 February 2013 at 06:02:04 UTC, Ali Çehreli wrote:
> Elements: 65536, Allocations: 9, Moved: 1012
> Elements: 131072, Allocations: 10, Moved: 28655
> [[ Elements: 262144, Allocations: 9, Moved: 1012 ]]
> Elements: 524288, Allocations: 12, Moved: 435173
> Elements: 1048576, Allocations: 13, Moved: 1431520
> [[ Elements: 2097152, Allocations: 11, Moved: 1993706 ]]
> Elements: 4194304, Allocations: 13, Moved: 5877728
> Elements: 8388608, Allocations: 14, Moved: 14838747
> [[ Elements: 16777216, Allocations: 12, Moved: 30438373 ]]
> Elements: 33554432, Allocations: 12, Moved: 59881445
> Elements: 67108864, Allocations: 12, Moved: 109627365

That's quite an oddity to me, especially looking at the code.


More information about the Digitalmars-d-learn mailing list