Dynamic Array reserve

Steven Schveighoffer schveiguy at yahoo.com
Sun Dec 17 16:43:26 UTC 2017


On 12/17/17 11:18 AM, Vino wrote:
> On Sunday, 17 December 2017 at 00:45:06 UTC, Ali Çehreli wrote:
>> On 12/16/2017 03:58 PM, Steven Schveighoffer wrote:
>>
>>> [...]
>>
>> I was going to suggest the same to Vino and I was writing the 
>> following program to demonstrate how low the number of allocations is.
>>
>> [...]
> 
> Hi Steven /Ali,
> 
>    Initially we use the native array and we observed the execution time 
> was higher so we  then we changed all the native array to container 
> array and we were able to see some performance gain, the memory usage is 
> not a constrain for us, are main goal is how fast the program can 
> perform. Please let me know your thoughts on the same.
> 

Yeah, the main reason to use Array is for performance.

Note, you may have better performance with Appender as well, as it does 
not need to query the GC for metadata.

-Steve


More information about the Digitalmars-d-learn mailing list