Optimizations and performance

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 9 09:20:38 PDT 2016


On Thursday, 9 June 2016 at 15:57:02 UTC, Dave wrote:
> But not give to much information about the language.

All ordinary imperative languages are equal in theoretical 
performance. No point in trying to "benchmark" languages. You 
always benchmark compiler (and runtime) + hardware.

> For instance if you benchmark a while loop in C, C++, Rust, and 
> D all with LLVM backends...well the slower language really is 
> just pointing towards some ineffectiveness of the compiler 
> itself, as in a simple example, there really shouldn't be much 
> difference. However, if you want to say "D has this feature 
> which produces better performance than what those language can 
> provide", that's a different story.

Well, it doesn't and cannot have a feature that inherently is 
performant. It is the compiler's ability to detect opportunities 
for making things simpler or fit the hardware better that matters.

The backend matters, but usually you can do high level 
optimization before you reach that stage. That's why you want to 
benchmark language constructs. To see how well it does high level 
optimization, not only the easier low level optimization.



More information about the Digitalmars-d mailing list