Re: PSA: You likely want to use -O2 for the stage1 compiler.

2018-08-04 Thread Artem Pelenitsyn
Thanks, Andreas!

I believe, the wiki modestly tries to suggest this here:
https://ghc.haskell.org/trac/ghc/wiki/Building/Using#Workingonanoptimizedstage2compiler.
Maybe, it should be more insistent, e.g., by adding these numbers or moving
the advice to a more visible place. Not sure.

--
Best, Artem

On Sun, 5 Aug 2018 at 01:58 Andreas Klebinger 
wrote:

> I've wondered for a good while if using O2 on stage1 might be worth it.
>
> So I did some measurements and it should be worth it for most cases.
>
> For a single "quick" flavour build they are more or less on equal footing.
> If you rebuild stage2 multiple times reusing stage1 it will be faster.
> If you build stage2 with optimizations/profiling it will be faster.
>
> Below are the timings using "time make -j9" for a quick build.
> I forgot to write down the seconds as I didn't expect them to be so close.
> But it is what it is.
>
> Timings stage1 options O1 vs O2, quick build after make clean:
>
> stage1 opt | time (wall) | time (user)
> -O1|   13m   |   53m
> -O2|   13m   |   51m
>
> I've also run the numbers for a optimized stage2 compiler a while ago,
> where stage1 with O2 was faster.
> But I no longer have these numbers around.
>
> So it seems safe to say one should use O2 if either:
> * stage2 is built with optimizations
> * you freeze stage1 and reuse it while working on stage2
>
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


PSA: You likely want to use -O2 for the stage1 compiler.

2018-08-04 Thread Andreas Klebinger

I've wondered for a good while if using O2 on stage1 might be worth it.

So I did some measurements and it should be worth it for most cases.

For a single "quick" flavour build they are more or less on equal footing.
If you rebuild stage2 multiple times reusing stage1 it will be faster.
If you build stage2 with optimizations/profiling it will be faster.

Below are the timings using "time make -j9" for a quick build.
I forgot to write down the seconds as I didn't expect them to be so close.
But it is what it is.

Timings stage1 options O1 vs O2, quick build after make clean:

stage1 opt | time (wall) | time (user)
-O1|   13m   |   53m
-O2|   13m   |   51m

I've also run the numbers for a optimized stage2 compiler a while ago,
where stage1 with O2 was faster.
But I no longer have these numbers around.

So it seems safe to say one should use O2 if either:
* stage2 is built with optimizations
* you freeze stage1 and reuse it while working on stage2


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs