Rquest for timings

bearophile bearophileHUGS at lycos.com
Fri Nov 25 05:14:41 PST 2011


Andrea Fontana:

> Hmm reading code i verified that i can gain a 10% writing:
> 
>                     imd dSquared = sqrt(dx ^^ 2 + dy ^^ 2 + dz ^^ 2);
>                     imd mag = dt / (dSquared * dSquared^^2);
> 
> Around line 115. Give it a try... 

My version performs a sqrt and one multiplication, while your version performs one sqrt and two multiplications. On my PC my version is faster.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list