Building DMD (excluding phobos and druntime, no optimizations) with the official 32-bit Windows release of DMD 2.089 takes about ~40% more time to finish than it did with DMD 2.088.1. For the comparison, 64-bit DMD (built with LDC2 and optimizations enabled) for both versions takes much less time than 32-bit counterparts. Here are some measurements taken with my i7-2600K @ 4.2GHz: DMD32 2.089: ~11 seconds DMD32 2.088.1: ~8 seconds DMD64 2.089: ~5 seconds DMD64 2.088.1: ~5 seconds
Just to clarify: this performance regression does not just apply to compiling DMD, it also affects other projects as well.
It looks like the official builds are compiled with ENABLE_DEBUG=1, which also explains why my own DMD built DMD builds are faster too (~6 seconds with DMD32, ~7 seconds with DMD64).
Could it be that this solves your issue? https://github.com/dlang/dmd/pull/10663
I can't possibly know, I had no issues with building the DMD myself with these flags, the problem lies in the officially distributed binaries which seems to be missing them, and I have no idea how they are exactly built.
Maybe it wasn't clear enough, but the measurements in my first posts were measured with DMD binaries downloaded from https://dlang.org/download.html and building the same project with those versions, which in this case it was DMD ~master or DMD 2.088.1. Using my own binaries (the DMD64 versions, but DMD32 performs similarly) with ENABLE_RELEASE=1 does not show this regression at all.
DMD 2.089.1 came out today and is still significantly slower than my own builds.
dmd 2.090 is still slower than 2.088. dmd.exe is also built with debug symbols and contains strings only used by assertions, so I suspect it's just a debug build. dub.exe also contains debug symbols, but it has always been this way. Maybe a locally modified makefile during release build is also causing the dmd version to have the suffix -dirty. @Martin any idea?
@rainers created dlang/dmd pull request #10721 "fix Issue 20391 - [REG 2.089] DMD compile times increased by 40% beca…" fixing this issue: - fix Issue 20391 - [REG 2.089] DMD compile times increased by 40% because ENABLE_RELEASE=0 in build build release with ENABLE_RELEASE=1 https://github.com/dlang/dmd/pull/10721
How worth is this to fix considering that there are plan to deactivate -release for the official build ? https://github.com/dlang/dmd/pull/10679
dlang/dmd pull request #10721 "fix Issue 20391 - [REG 2.089] DMD compile times increased by 40% beca…" was merged into stable: - 5da931ed8f56736fd08949dcdeaa5535944cc4ab by Rainer Schuetze: fix Issue 20391 - [REG 2.089] DMD compile times increased by 40% because ENABLE_RELEASE=0 in build build release with ENABLE_RELEASE=1 https://github.com/dlang/dmd/pull/10721
(In reply to Basile-z from comment #9) > How worth is this to fix considering that there are plan to deactivate > -release for the official build ? Building without -release is different from building without optimizations. Enabling asserts will probably cost a couple of percent, not 30-40%.
Here are the latest measurements when building a project including few dependencies with DUB (results are not comparable to my previous post): 2.089.0 built with LDC2 time elapsed: 8.2s 2.089.0 time elapsed: 15.3s 2.090.0 time elapsed: 15.3s 2.090.1-beta time elapsed: 11.0s The beta release clearly helped with the performance, but there are still room for improvements. You really should consider using LDC2 for final builds which seems to produce way more optimized binaries than DMD.
see https://github.com/dlang/installer/pull/425