[GHC] #14208: Performance with O0 is much better than the default or with -O2, runghc performs the best

GHC ghc-devs at haskell.org
Tue Mar 27 08:07:01 UTC 2018


#14208: Performance with O0 is much better than the default or with -O2, runghc
performs the best
-------------------------------------+-------------------------------------
        Reporter:  harendra          |                Owner:  osa1
            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 simonpj):

 > So I think in the compiled case there are no problems.

 OK good; that's reassuring.

 Do you know why the single-module case gets better?  I suspect it may be
 that `toList` is specialised.  If you add `{-# INLINABLE toList #-}` does
 the difference go away?

 Perhaps this isn't a big deal -- it's reasonable for single module to be
 faster -- but GHC does make real efforts NOT to penalise you for multi-
 module, so I'm curious.

 > Only remaining question is why GHCi is faster than compiled code.

 Can you reproduce this difference?  It is indeed puzzling!

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


More information about the ghc-tickets mailing list