Programming-Language-Benchmarks
Programming-Language-Benchmarks copied to clipboard
D .yml should use LTO and vectorization
You have vectorization but not LTO.
Hi Max, could you please specify exactly which compilation keys should be added?
Adding -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto to dub.json flags for "ldc" makes fasta and mandelbrot on my machine even slower :) Maybe something wrong with the build..
A lot of the impls are quite slow in the first place, I made one 400x faster I'll push it soon
@cyrusmsk It would be good to ask @kinke (LDC maintainer) about what flags to use to get the most out of the bench code. Probably same for GDC with @ibuclaw
@GavinRay97 another thing about it - is that code by itself and compilation parameters should be comparable between different languages and realizations. So I think we should check top rows and see their compilation flags (Rust, Zig, C) and choose similar options for D. Because some of the problems are possible to solve in compile time and have almost 0 at runtime :) which obviously will be the not acceptable hack
So I think we should check top rows and see their compilation flags (Rust, Zig, C) and choose similar options for D.
Yep; I've had an extremely quick look and noticed that e.g. Rust seems to tailor LLVM codegen to Broadwell, while there's no such 'tweak' for LDC (which defaults to Pentium 4 when targeting non-Mac x86_64...). The according LDC flag would be -mcpu=broadwell
.
If https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/36514172486b4c90609d7591d16380b0e1b40297/bench/bench_d.yaml#L68-L69 is what controls the builds, the actual compiler args can be controlled via the DFLAGS env var (without the build/package manager dub
interfering), e.g., DFLAGS="-O -release -mcpu=broadwell" dub build --compiler=ldc2 -v
.
Oh, just seen https://github.com/hanabi1224/Programming-Language-Benchmarks/blob/36514172486b4c90609d7591d16380b0e1b40297/bench/include/d/dub.json#L12
That flag isn't accepted by LDC (mcpu
, not march
); I guess it only works because dub would need a dflags-ldc
(vs. dflags-ldc2
).