Can this implementation of Damm algorithm be optimized?

Era Scarecrow via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Feb 11 21:54:34 PST 2017


On Saturday, 11 February 2017 at 21:56:54 UTC, Era Scarecrow 
wrote:
>  Just ran the unittests under the dmd profiler, says the 
> algorithm is 11% faster now. So yeah slightly more optimized.

Ran some more tests.

Without optimization but with with 4 levels (a 2.5Mb table), it 
gains to a whopping 27%!
However with optimizations turned on it dwindled to a mere 15% 
boost
And optimization + no bounds checking, 2 & 4 levels both give a 
9% boost total.

Testing purely on 8byte inputs (Brute forced all combinations) 
receives the same 9% boost with negligible difference.

Safe to say going higher levels isn't going to give you 
sufficient improvement; Also exe file is 3Mb big (but compresses 
to 150k).


More information about the Digitalmars-d-learn mailing list