On Thursday, 1 April 2021 at 17:30:15 UTC, Chris Piker 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.

Nice test. I'm new to D as well and can't comment on needed refactoring. To confirm your results I compiled the D example using:

```
gdc -O2 speed.d -o speed
```

and measured 129 ms for the D program and 63 ms for the python3 equivalent.

I'll be keen to see how this plays out since I'm using D as a faster alternative to python.

I have made 4 variants of the code and get:
20 ms (mylist ~= n and mylist.sort)
8 ms (mylist[number] = n and concurrent sort)
10 ms (parallel assignment and mylist.sort)
5 ms (parallel assignment and concurrent.sort)

Also make sure you build your application in release mode, this made quite some difference.

Reply via email to