mysterious performance gain

Wayne Anderson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 18 12:37:39 PDT 2014


On Friday, 18 July 2014 at 13:21:09 UTC, Archibald wrote:
> Hello,
> So I have this big, performance critical function that takes 
> about 9 seconds to execute. If I add :
>
> double[] direct = new double[2];
>
> ... at the beggining of the function, with no further reference 
> to this array, suddenly it takes only 8 seconds.
>
> Any rational explaination to this? ( Seems unrelated to garbage 
> collection )

Perhaps some function your critical code calls might require 
memory to be aligned to a particular offset (say 16 byte). What 
made you think of adding the unused array?


More information about the Digitalmars-d-learn mailing list