LDC 1.25.0

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Feb 23 22:00:53 UTC 2021


On Tue, Feb 23, 2021 at 07:32:13PM +0000, kinke via Digitalmars-d-announce wrote:
> On Tuesday, 23 February 2021 at 18:19:09 UTC, H. S. Teoh wrote:
> > Tested this on one of my projects yesterday. For -O3, it reduced
> > compile time by about ~26%.  For -O, it reduced compile time by
> > about 24%.  Not as much as I'd hoped, but still pretty big
> > reductions.
> 
> Thx for some numbers. [Note that -O == -O3 == -O4 == -O5, they are all
> the same (at least for now), contrary to what you might read
> somewhere.] A reduction by 25%, i.e., a 1.33x speed-up, for code that
> is guaranteed to be at least as fast as before (higher cross-module
> inlining potential) isn't too bad, aye? :)

Yeah actually it's pretty good.  It's only that my expectations were a
bit high when you reported 50+% reductions in compile times. :-)


> > For non-optimized builds, it reduced compile times by only 1-2%
> > (pretty insignificant).
> 
> I find it rather interesting that it isn't any slower. Compiling debug
> Phobos all-at-once took 67% longer on my box (and increased the static
> lib size by 76%). Without -O, I've only seen some improvements with
> `-unittest`.
[...]

Interesting indeed. I just did a quick test with -unittest, and got
these numbers:

-unittest:				15.9 sec
-unittest -linkonce-templates:		22.3 sec
-unittest -O:				54.4 sec
-unittest -O -linkonce-templates:	40.7 sec

Apparently with -unittest it *does* run slower without -O. But with -O,
it does run faster.


T

-- 
It won't be covered in the book. The source code has to be useful for something, after all. -- Larry Wall


More information about the Digitalmars-d-announce mailing list