Compiling DUB with all compilers yields to these binaries:
Compiler | Size
---------|------
DMD | 17M
LDC | 13M
GDC | 19M
See also:
https://github.com/dlang/dub/pull/1369#discussion_r167407362
Note that LDC has LTO easily available which results in ~10% performance improvement and also a noticeable binary size reduction.
DUB is currently compiled with DMD, because LDC doesn't support showing the stack for exceptions, but imho the vast increase in speed and reduced side justifies overlooking this. After all, this is a production release - not a debug build.
Performance-wise I haven't done big tests, but a build of vibe.d without needing to rebuild goes reproducible down from 0.22s to 0.15s
> Do you use phobos compiled for LTO too?
Not for this quick benchmark - the main point of this issue was just to point out that we should be using LDC for building the DUB binaries due to smaller size + better performance (though to be fair I don't have good numbers for this and it's partially backed up by prior DMD vs. LDC benchmarks).
Comment #4 by pro.mathias.lang — 2020-04-08T10:52:29Z
This sounds like a DUB issue, and has been fixed in DUB a while ago.