Bug 880135

Summary: build all packages with ghc -O2
Product: [Fedora] Fedora Reporter: Dag Odenhall <dag.odenhall>
Component: ghc-rpm-macrosAssignee: Jens Petersen <petersen>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: haskell-devel, petersen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-20 02:31:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dag Odenhall 2012-11-26 10:43:44 UTC
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 07:35:47 UTC
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 07:53:59 UTC
(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 17:01:22 UTC
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 16:32:47 UTC
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-06 02:47:01 UTC
I thinking to do this now for F20.

Hints on how to do that also welcome. :)

Comment 6 Jens Petersen 2013-06-06 03:01:33 UTC
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 09:00:13 UTC
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 12:47:10 UTC
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 08:28:03 UTC
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