On Saturday, 21 May 2016 at 08:23:59 UTC, Johan Engelen wrote:
On Friday, 20 May 2016 at 23:16:01 UTC, Richard Delorme wrote:

The source can be compiled with dmd, ldc or gdc, but the best performance are obtained with the latter (almost twice faster).

Can you give cmdline details and compiler version data for this? (how much faster is gdc relative to ldc?)

I used the following compiler versions,

dmd: DMD64 D Compiler v2.071.0
ldc: 0.17.0-beta2 (DMD v2.068.2, LLVM 3.7.1)
gdc: gcc version 5.2.0 (crosstool-NG 203be35 - 20160205-2.066.1-e95a735b97)

to compile, you can use the following commands:
$ DC=ldc2 make amoeba (to compile with ldc)
$ DC=dmd make amoeba (to compile with dmd)
$ DC=gdc make amoeba  (to compile with gdc)
$ make amoeba (use gdc by default)
$ make pgo (for profile guided optimization),
$ make pgo BUILD=popcount (to use the CPU popcnt instruction)
With the above versions & my poor knowledge of the compilers, pgo & BUILD=popcount only worked with gdc. I will try to upgrade to more recent versions to see if things changed.

to test the speed , you can do:
amoeba bench -f bk.epd -d 14

Here is what I get on my computer (an old i7 2600k at 4Ghz):
dmd: 24 positions 29981105 nodes in 20.000s : 1499024 nps, depth = 13.71 ldc2: 24 positions 29981105 nodes in 18.340s : 1634711 nps, depth = 13.71 gdc: 24 positions 29981105 nodes in 12.005s : 2497388 nps, depth = 13.71 gdc+pgo: 24 positions 29981105 nodes in 10.224s : 2932328 nps, depth = 13.71 * gdc used the BUILD=popcount options. without, it is slower, doing the test in 15.4. & 13.6 s., respectively for gdc & gdc + pgo. So gdc benefits a lot from both pgo and using the popcnt instruction.

--
Richard

Reply via email to