Naive node.js faster than naive LDC2?

James Lu jamtlu at gmail.com
Fri Aug 21 23:22:27 UTC 2020


On Friday, 21 August 2020 at 23:14:12 UTC, James Lu wrote:
> On Friday, 21 August 2020 at 23:10:53 UTC, James Lu wrote:
>> Code: 
>> https://gist.github.com/CrazyPython/364f11465dab90d611ecc81490682680
>>
>> LDC 1.23.0 (Installed from dlang.org)
>>
>> ldc2 -release -mcpu=native -O3 -ffast-math --fp-contract=fast
>>
>> Node v14.40 (V8 8.1.307.31)
>>
>> Dlang trials: 2957 2560 2048 Average: 2521
>> Node.JS trials: 1988 2567 1863 Average: 2139
>>
>> Notes:
>>
>>  - I had to reinstall Dlang from the install script
>>  - I was initially confused why -mtune=native didn't work, and 
>> had to read documentation. Would have been nice if the 
>> compiler told me -mcpu=native was what I needed.
>>  - I skipped -march=native. Did not find information on the 
>> wiki https://wiki.dlang.org/Using_LDC
>>  - Node.js compiles faster and uses a compilation cache
>>
>> Mandatory citation: 
>> https://github.com/brion/mandelbrot-shootout
>
> With the double type:
>
> Node: 2211 2574 2306
> Dlang: 2520 1891 1676

Bonus: Direct translation of Dlang to Node.js, Node.js faster 
https://gist.github.com/CrazyPython/8bafd16837ec8ad4c5a638b9d305fc96

Dlang: 4076 3622 2934 (3544 average)
Node.js: 2624 2334 2316 (2424 average)

LDC2 is 46% slower!


More information about the Digitalmars-d mailing list