Naive node.js faster than naive LDC2?
bachmeier
no at spam.net
Sat Aug 22 02:08:40 UTC 2020
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
I have no desire to dig into it myself, but I'll just note that
if you check the CLBG, you'll see that it's not hard to write C
and C++ programs for this benchmark that are many times slower
than Node JS. The worst of them takes seven times longer to run.
More information about the Digitalmars-d
mailing list