Passing parameter when creating object array

Kirk McDonald kirklin.mcdonald at gmail.com
Tue Aug 7 14:36:49 PDT 2007


Chris Nicholson-Sauls wrote:
>> But honestly, I don't think the cost is worth worrying too much about. 
>> I ran a quick test timing my function above against a simple foreach 
>> over an pre-allocated array.  The 'populate' function averaged only 10 
>> microseconds slower.  I, for one, can handle 10 millionths of almost 
>> anything.  :)
>>
>> -- Chris Nicholson-Sauls
> 
> 
> Oh yes, I should probably also mention that my test program was creating 
> arrays of 1000 objects -- not just 50.  :)  So for use cases such as in 
> the OP, the difference is utterly insignificant.
> 
> -- Chris Nicholson-Sauls

Hence why I said I wasn't sure how serious of an issue this is. :-)

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org


More information about the Digitalmars-d-learn mailing list