Is there any language that native-compiles faster than D?
Per Nordlöw
per.nordlow at gmail.com
Fri Sep 25 16:01:32 UTC 2020
On Thursday, 20 August 2020 at 20:50:25 UTC, Per Nordlöw wrote:
> After having evaluated the compilation speed of D compared to
> other languages at
>
> https://github.com/nordlow/compiler-benchmark
>
> I wonder; is there any language that compiles to native code
> anywhere nearly as fast or faster than D, except C?
>
> If so it most likely needs to use a backend other than LLVM.
>
> I believe Jai is supposed to do that but it hasn't been
> released yet.
I just added support for Apple's Swift. It's massively slow on
Linux. Check is 61 times slower than dmd and build is 42 times
slower than dmd.
./benchmark --languages=D,Swift --function-count=200
--function-depth=450 --run-count=1
outputs (in Markdown)
| Lang-uage | Oper-ation | Temp-lated | Op Time [us/#fn] |
Slowdown vs [Best] | Run Time [us/#fn] | Version | Exec |
| :---: | :---: | --- | :---: | :---: | :---: | :---: | :---: |
| D | Check | No | 7.5 | 1.0 [D] | N/A |
v2.094.0-rc.1-75-ga0875a7e0 | `dmd` |
| D | Check | No | 8.5 | 1.1 [D] | N/A | 1.23.0 | `ldmd2` |
| D | Check | Yes | 19.8 | 2.6 [D] | N/A |
v2.094.0-rc.1-75-ga0875a7e0 | `dmd` |
| D | Check | Yes | 22.9 | 3.0 [D] | N/A | 1.23.0 | `ldmd2` |
| D | Build | No | 27.1 | 1.0 [D] | 50 |
v2.094.0-rc.1-75-ga0875a7e0 | `dmd` |
| D | Build | No | 205.6 | 7.6 [D] | 108 | 1.23.0 | `ldmd2` |
| D | Build | Yes | 38.2 | 1.4 [D] | 31 |
v2.094.0-rc.1-75-ga0875a7e0 | `dmd` |
| D | Build | Yes | 214.7 | 7.9 [D] | 113 | 1.23.0 | `ldmd2` |
| Swift | Check | No | 461.4 | 61.3 [D] | N/A | 5.3 | `swiftc` |
| Swift | Build | No | 1133.4 | 41.8 [D] | 61 | 5.3 | `swiftc` |
I'll rerun all the benchmarks now.
More information about the Digitalmars-d
mailing list