<div dir="ltr">I think at first you just give it a -f flag, and let experience determine whether it should be part of -O or -O2.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 27, 2019 at 12:10 PM Andreas Klebinger <<a href="mailto:klebinger.andreas@gmx.at">klebinger.andreas@gmx.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello ghc-devs and haskell users.<br>
<br>
I'm looking for opinions on when an optimization should be enabled by<br>
default.<br>
<br>
-O is currently the base line for an optimized build.<br>
-O2 adds around 10-20% compile time for a few % (around 2% if I remember<br>
correctly) in performance for most things.<br>
<br>
The question is now if I implement a new optimization, making code R%<br>
faster but slowing<br>
down the compiler down by C% at which point should an optimization be:<br>
<br>
* Enabled by default (-O)<br>
* Enabled only at -O2<br>
* Disabled by default<br>
<br>
Cheap always beneficial things make sense for -O<br>
Expensive optimizations which add little make sense for -O2<br>
<br>
But where exactly is the line here?<br>
How much compile time is runtime worth?<br>
<br>
If something slows down the compiler by 1%/2%/5%<br>
and speeds up code by 0.5%/1%/2% which combinations make sense<br>
for -O, -O2?<br>
<br>
Can there even be a good policy with the -O/-O2 split?<br>
<br>
Personally I generally want code to either:<br>
* Typecheck/Run at all (-O0, -fno-code, repl)<br>
* Not blow through all my RAM when adding a few Ints while developing: -O ?<br>
* Make a reasonable tradeoff between runtime/compiletime: -O ?<br>
* Give me all you got: -O2 (-O99999)<br>
<br>
The use case for -O0 is rather clear, so is -O2.<br>
But what do people consider the use case for -O<br>
<br>
What trade offs seem acceptable to you as a user of GHC?<br>
<br>
Is it ok for -O to become slower for faster runtimes? How much slower?<br>
Should all new improvements which might slow down compilation<br>
be pushed to -O2?<br>
<br>
Or does an ideal solution add new flags?<br>
Tell me what do you think.<br>
<br>
Cheers,<br>
Andreas Klebinger<br>
<br>
_______________________________________________<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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>