Bug 880135 - build all packages with ghc -O2
build all packages with ghc -O2
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: ghc-rpm-macros (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jens Petersen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-26 05:43 EST by Dag Odenhall
Modified: 2014-01-29 03:28 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-19 22:31:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Dag Odenhall 2012-11-26 05:43:44 EST
Problem:

If you want to compile your Haskell application with -O2, only parts of it will be - most system packages are already built with -O1. All your own code is going to link to those prebuilt binaries.

Does it matter?

Respectable people in the community claim -O2 really does produce better code:

http://stackoverflow.com/questions/11108746/difference-between-ghcs-o-and-o2

Cons:

The fedora packages will take longer to build.

Counter argument:

This shouldn't happen often though, and I guess is done by some build service [koji?].  Users will just install prebuilt packages with no compilation time at all and benefit from optimized binaries.

Footnote:

This is only about building the fedora packages with -O2.  Our cabal-install package should not be changed to default to -O2 for user compilation.
Comment 1 Jens Petersen 2012-11-28 02:35:47 EST
So you are suggesting basically all libraries and executables from base and upwards, right?
Should the ghc compiler itself also be built with -O2?
Comment 2 Dag Odenhall 2012-11-28 02:53:59 EST
(In reply to comment #1)
> So you are suggesting basically all libraries and executables from base and
> upwards, right?
> Should the ghc compiler itself also be built with -O2?

I'm primarily talking about libraries here, as those are what user-compiled code will link to. I suppose it follows then that this also means GHC libraries like ghc-prim, and that the GHC executable itself is "optional".
Comment 3 Fedora End Of Life 2013-04-03 13:01:22 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 4 Fedora Admin XMLRPC Client 2013-05-20 12:32:47 EDT
The Fedora 20 component was created in error. We only create new Fedora versions when we branch a new release. These bugs are all being moved to rawhide. 

Please retarget them to 19 if they also apply to the Fedora 19 branched release. 

Thanks.
Comment 5 Jens Petersen 2013-06-05 22:47:01 EDT
I thinking to do this now for F20.

Hints on how to do that also welcome. :)
Comment 6 Jens Petersen 2013-06-05 23:01:33 EDT
Okay seems ghc can be done with "BuildFlavour=perf" in build.mk.

It should be easy enough to make ghc-rpm-macros pass -O2 to Cabal.
Comment 7 Jens Petersen 2013-06-06 05:00:13 EDT
Okay the changes have been committed to master.
They should appear in f20 rawhide when ghc-7.6.3 building starts.
Comment 8 Jens Petersen 2013-06-21 08:47:10 EDT
This should be in tomorrow's rawhide.

I am not sure how to verify -O2 other than looking at buildlogs.
ghc feels faster though I haven't benchmarked -
but I think compiling packages with -O2 somewhat "cancels"
the build speedup effect. ;)
Comment 9 Fedora Update System 2014-01-29 03:28:03 EST
ghc-7.4.2-11.2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ghc-7.4.2-11.2.fc19

Note You need to log in before you can comment on or make changes to this bug.