Reflections on isPalindrome

MattCoder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 28 07:09:49 PDT 2014


On Tuesday, 28 October 2014 at 13:30:05 UTC, Nordlöw wrote:
> On Tuesday, 28 October 2014 at 11:51:42 UTC, MattCoder wrote:
>> I forgot to say that I'm compiling with DMD without any 
>> compiler hints/optimizations.
>
> Try compiling with DMD flag
>
> -release
>
> and perhaps also
>
> -release -noboundscheck
>
> to get relevant results.
>
> DMD is currently not that good at inlining range primitives.

Interesting!

With -release the second version still faster but only by 10%.

Now with: -release -noboundscheck they are equal and sometimes 
your version is slightly faster by ~3 milliseconds.

Matheus.


More information about the Digitalmars-d-learn mailing list