#3736: GHC specialising instead of inlining
-----------------------+----------------------------------------------------
    Reporter:  guest   |       Owner:                         
        Type:  bug     |      Status:  new                    
    Priority:  normal  |   Component:  Compiler               
     Version:  6.10.4  |    Keywords:                         
          Os:  Linux   |    Testcase:                         
Architecture:  x86     |     Failure:  Runtime performance bug
-----------------------+----------------------------------------------------
 In the attached module I demonstrate the following:

 mainMonolithic1Generator performs the same computation as
 mainMonolithic1Compose
 but the former is more than two times slower than latter.
 This is serious since in more complex signal processing programs
 this factor seems to multiply.
 I assume that the problem is that mixGen is not inlined.
 Instead GHC seems to have decided to specialise mixGen.
 In contrast to mainMonolithic1Compose,
 mainMonolithic1Generator uses a data type with existential quantification.
 But this alone is not the problem,
 since mainMonolithic0 and mainMonolithic0Generator run with the same
 speed.

 http://code.haskell.org/storablevector/speedtest/SpeedTestChorus.hs

 How can I tell GHC to prefer inlining to specialisation?
 How about a pragma like {-# INLINE FORCE #-} or so?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3736>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to