Simple performance question from a newcomer

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 21 08:20:30 PST 2016


On Sunday, 21 February 2016 at 14:32:15 UTC, dextorious wrote:
> I had heard while reading up on the language that in D explicit 
> loops are generally frowned upon and not necessary for the 
> usual performance reasons.

First, a minor point, the D community is usually pretty careful 
not to frown on a particular coding style (unlike some 
communities) so if you are comfortable writing loops and it gives 
you the fastest code, you should do so.

On the performance issue, you can see this related post about 
performance with reduce:
http://forum.dlang.org/post/mailman.4829.1434623275.7663.digitalmars-d@puremagic.com

This was Walter's response:
http://forum.dlang.org/post/mlvb40$1tdf$1@digitalmars.com

And this shows that LDC flat out does a better job of 
optimization in this case:
http://forum.dlang.org/post/mailman.4899.1434779705.7663.digitalmars-d@puremagic.com


More information about the Digitalmars-d-learn mailing list