On Thursday, 1 April 2021 at 19:00:08 UTC, Berni44 wrote:
On Thursday, 1 April 2021 at 16:52:17 UTC, Nestor wrote:
I was hoping to beat my dear Python and get similar results to
Go, but that is not the case neither using rdmd nor running
the executable generated by dmd. I am getting values between
350-380 ms, and 81ms in Python.
Try using ldc2 instead of dmd:
```
ldc2 -O3 -release -boundscheck=off -flto=full
-defaultlib=phobos2-ldc-lto,druntime-ldc-lto speed.d
```
should produce much better results.
It did! Tried those flags with dmd and ldc and got the following
(ms) for the approaches I had earlier (made two runs for each)
DMD
11
7
6
4
DMD
15
7
10
6
LDC
6
7
9
6
LDC
12
6
8
5