Can this implementation of Damm algorithm be optimized?

Nestor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 9 14:04:05 PST 2017


On Thursday, 9 February 2017 at 21:43:08 UTC, Daniel Kozak wrote:
>> Any idea of what might be happening here?
> Did you try it with different backends? llvm (ldc), gcc(gdc)?

Not really, just standard dmd.

I tried running each algoritm a few times through avgtime using 
different digit lengths (upto 10,000, my PC won't handle much 
more) and different amount of repetitions, and the results aren't 
consistent, some times one algorithm is marginally faster, 
sometimes the other. Apparently the compiler is capable of 
optimizing the unidimensional array version.

Thank you all nevertheless for the suggestions.


More information about the Digitalmars-d-learn mailing list