Optimize my code =)
John Colvin
john.loughran.colvin at gmail.com
Fri Feb 21 05:02:06 PST 2014
On Thursday, 20 February 2014 at 21:32:10 UTC, Robin wrote:
> Hiho,
>
> here are the results of both compilers (DMD and LDC2) on my
> system:
>
> LDC:
> =========================================
> allocationTest ...
> Time required: 5 secs, 424 msecs
> multiplicationTest ...
> Time required: 1 secs, 744 msecs
> toStringTest ...
> Time required: 0 secs, 974 msecs
> transposeTest ...
> Time required: 0 secs, 998 msecs
> scalarMultiplicationTest ...
> Time required: 0 secs, 395 msecs
> matrixAddSubTest ...
> Time required: 0 secs, 794 msecs
> matrixEqualsTest ...
> Time required: 0 secs, 0 msecs
> identityMatrixTest ...
> Time required: 0 secs, 393 msecs
> =========================================
>
> DMD:
> =========================================
> allocationTest ...
> Time required: 3 secs, 161 msecs
> multiplicationTest ...
> Time required: 2 secs, 6 msecs
> toStringTest ...
> Time required: 1 secs, 365 msecs
> transposeTest ...
> Time required: 1 secs, 45 msecs
> scalarMultiplicationTest ...
> Time required: 0 secs, 405 msecs
> matrixAddSubTest ...
> Time required: 0 secs, 809 msecs
> matrixEqualsTest ...
> Time required: 0 secs, 430 msecs
> identityMatrixTest ...
> Time required: 0 secs, 350 msecs
> =========================================
>
> All in all I must say that I am more pleased with the DMD
> results as I am kind of worried about the LDC allocation test
> performance ...
>
> I also had to rewrite parts of the codes as some functions just
> weren't "pure" or "nothrow" such as the whole things around
> this.data[] += other.data[].
>
> Robin
what flags did you use?
More information about the Digitalmars-d-learn
mailing list