Investigation: downsides of being generic and correct

bearophile bearophileHUGS at lycos.com
Thu May 16 04:37:12 PDT 2013


Dicebot:

> I did explore issue a bit and reported results in a blog post 
> (snippets are really small and simple) : 
> http://dicebot.blogspot.com/2013/05/short-performance-tuning-story.html

In the first of his posts I don't see -noboundscheck used, and it 
compares different algorithms from C++ (a switch) and D (two 
nested ifs, that are not optimal).

 From my experience if you have some care you are able to write D 
code for LDC that is about as fast as equivalent as C code, or 
better.


> One open question remains though - can D/Phobos do better here?

Of course.

Bye,
bearophile


More information about the Digitalmars-d mailing list