<div dir="ltr"><div>Thanks, Andreas!</div><div><br></div><div>I believe, the wiki modestly tries to suggest this here:<br></div><div><a href="https://ghc.haskell.org/trac/ghc/wiki/Building/Using#Workingonanoptimizedstage2compiler.">https://ghc.haskell.org/trac/ghc/wiki/Building/Using#Workingonanoptimizedstage2compiler.</a></div><div>Maybe, it should be more insistent, e.g., by adding these numbers or moving the advice to a more visible place. Not sure.</div><div><br></div><div>--</div><div>Best, Artem<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, 5 Aug 2018 at 01:58 Andreas Klebinger <<a href="mailto:klebinger.andreas@gmx.at">klebinger.andreas@gmx.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
  <span style="font-family:monospace">I've wondered for a good while 
if using O2 on stage1 might be worth it.<br>
    <br>
So I did some measurements and it should be worth it for most cases.<br>
    <br>
For a single "quick" flavour build they are more or less on equal 
footing.<br>
If you rebuild stage2 multiple times reusing stage1 it will be faster.<br>
If you build stage2 with optimizations/profiling it will be faster.<br>
    <br>
Below are the timings using "time make -j9" for a quick build.<br>
I forgot to write down the seconds as I didn't expect them to be so 
close.<br>
But it is what it is.<br>
    <br>
Timings stage1 options O1 vs O2, quick build after make clean:<br>
    <br>
stage1 opt | time (wall) | time (user)<br>
-O1        |   13m       |   53m<br>
-O2        |   13m       |   51m<br>
    <br>
I've also run the numbers for a optimized stage2 compiler a while ago,<br>
where stage1 with O2 was faster.<br>
But I no longer have these numbers around.<br>
    <br>
So it seems safe to say one should use O2 if either:<br>
* stage2 is built with optimizations<br>
* you freeze stage1 and reuse it while working on stage2<br>
    <br>
    <br>
  </span>
</div>

_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>