Optimizations and performance

Dave via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 9 07:40:25 PDT 2016


On Thursday, 9 June 2016 at 14:16:08 UTC, Jack Stouffer wrote:
> On Thursday, 9 June 2016 at 13:32:14 UTC, Dave wrote:
>> [...]
>
> I agree with your general point, but what I find most useful 
> about benchmarks is the ability to find the lower bound of 
> performance without resorting to inline asm or making the 
> program ugly as sin.
>
> If you can find, "In this particular task, D has these tricks 
> it can use to make it really fast", I think that's useful as 
> many other languages won't have those options. You can see how 
> much you as a programmer can optimize the hot points in your 
> code and how easy that is to do just by looking at the 
> benchmarked code.
>
> Appender!string is a great example, as it's easy to add and it 
> almost always results in measurable speed increases. You can 
> see how one simple change using D features can make your 
> program 5% faster.
>
> Every language has idiomatic uses to speed up your program, the 
> real question is how much faster those make the code and how 
> easy it is to implement those in your own code.

Based off what you said, I'm not sure we disagree at all. :)
My main point is no what you are really benchmarking. And just 
because you can make it go away doesn't mean it's not a problem 
still. Especially if it's the way you are supposed to use the 
language.


More information about the Digitalmars-d mailing list