May 22, 2016
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).

Allowing LDC to do cross-module optimisations (by adding the -singleobj flag) and make use of popcnt increased the performance by 47% for one specific benchmark, which should bring it into the same ballpark as GDC. See https://github.com/abulmo/amoeba/pull/2 for more details.

PGO might still give the latter a bit of an edge, though, as LDC's implementation is still experimental and there is a lot of unused potential for making use of the profile data in LLVM's optimiser.

 — David
May 22, 2016
On Sunday, 22 May 2016 at 11:20:44 UTC, John Colvin wrote:
> LDC might benefit from copying the _popcnt source from ldc's druntime in to your code as it has a problem inlining it from druntime. You might also see a benefit from the -single-obj flag (enabled by default in ldmd).

Thank you for those advices.
I succeeded to have popcnt in the LCD build, (using llvm_ctpop). -singleobj looks like a good idea too.

for the above test:
original: 18.7 s
with popcnt & singleobj: 11.1s.
LDC is now close to GDC in performance.
A question: why singleobj is not activated by a -Ox options?

--
Richard
May 22, 2016
On Sunday, 22 May 2016 at 15:48:13 UTC, Abdulhaq wrote:

> Do you plan to take it further?

Yes, but I do not expect to make it as strong as stockfish.
100 elo above the present level by the end of this year will be great.
I have ideas for improving the evaluation function, many things to tune, test or retest in the search.

--
Richard
May 22, 2016
On Sunday, 22 May 2016 at 21:22:30 UTC, Richard Delorme wrote:
> A question: why singleobj is not activated by a -Ox options?

It changes compiler behaviour – only a single object file is produced. Historically, the default behaviour was used by some people/build systems for incremental compilation.

However, since incremental compilation only works when exactly the same (sub)sets of commands are invoked every time these days, -singleobj should arguably be on by default, at least when producing an executable.

This is actually what ldmd2 does already, but we should probably take the plunge and break backwards compatibility to enable it for the main driver too. I can't think of a scenario where you wouldn't want to be using it.

 — David
May 23, 2016
On 05/20/2016 07:16 PM, Richard Delorme wrote:
> I am pleased to announce the release of a chess engine written in D:
> https://github.com/abulmo/amoeba
>
> I am not aware of any other chess engine written with the D language.
>
> The source can be compiled with dmd, ldc or gdc, but the best
> performance are obtained with the latter (almost twice faster).
>
> This is my first program using the D language (I am a former C
> programmer), and I enjoyed it a lot.

https://www.reddit.com/r/programming/comments/4koi8q/amoeba_a_chess_engine_written_in_d/

https://www.facebook.com/dlang.org/posts/1302718359741842

https://twitter.com/D_Programming/status/734769561518510081


Andrei

1 2
Next ›   Last »