[GHC] #14208: Performance with -O2 is worse than with -O0 which is worse than runghc

GHC ghc-devs at haskell.org
Mon Sep 11 02:44:13 UTC 2017


#14208: Performance with -O2 is worse than with -O0 which is worse than runghc
-------------------------------------+-------------------------------------
        Reporter:  harendra          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by harendra):

 Earlier I thought the problem occurs with `-O2` but that is not the case,
 `-O2` is irrelevant. `-O2` gives the same performance as the default i.e.
 without any optimization flags. The difference is between `-O0` and the
 absence of it. Adding `-O0` improves performance drastically. I have
 updated the github repo and removed `-O2`.

 This is such an ironic case, `runghc` has the best performance, the next
 best is `-O0` and any optimization is the worst! Maybe we should just
 reverse the flags :-)

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14208#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list