bearophile wrote:
Tomas Lindquist Olsen:
...
$ dmd bench.d -O -release -inline
long arith: 55630 ms
nested loop: 5090 ms
$ ldc bench.d -O3 -release -inline
long arith: 13870 ms
nested loop: 120 ms
$ gcc bench.c -O3 -s -fomit-frame-pointer
long arith: 13600 ms
nested loop: 170 ms
...
Very nice results.
If you have a little more time I have another small C and D benchmark to offer you, to be tested with GCC and
LDC. It's the C version of the "nbody" benchmarks of the Shootout, a very close translation to D
(file name "nbody_d1.d") and my faster D version (file name "nbody_d2.d") (the faster D
version is relative to DMD compiler, of course).
I haven't tried LDC yet, so I can't be sure of what the timings will tell.
Thank you for your work,
bearophile
IMHO, spectralnorm is 'a little bit' better than nbody.
:)