#2346: Compilation of large source files requires a lot of RAM
------------------------------------------+---------------------------------
 Reporter:  choener                       |          Owner:         
     Type:  compile-time performance bug  |         Status:  new    
 Priority:  normal                        |      Milestone:  6.10.1 
Component:  Compiler                      |        Version:  6.8.2  
 Severity:  major                         |     Resolution:         
 Keywords:                                |     Difficulty:  Unknown
 Testcase:                                |   Architecture:  x86    
       Os:  Linux                         |  
------------------------------------------+---------------------------------
Comment (by igloo):

 I'm not sure if this is the only problem, but one issue is that in a
 module like this:
 {{{
 module Test where

 f alg1 alg2 = (a1, a2, a3, a4, a5)
     where
       (a1_1, a2_1, a3_1, a4_1, a5_1) = alg1
       (a1_2, a2_2, a3_2, a4_2, a5_2) = alg2

       a1 x (y,z) = (a1_1 x y, a1_2 x z)
       a2 x (y,z) = (a2_1 x y, a2_2 x z)
       a3 x (y,z) = (a3_1 x y, a3_2 x z)
       a4 x (y,z) = (a4_1 x y, a4_2 x z)
       a5 x (y,z) = (a5_1 x y, a5_2 x z)
 }}}

 we end up with a quadratic amount of code (and also, I think, a quadratic
 amount of type)

 e.g. in the above module we get 5 things like this:
 {{{
        \ (x_ag3 :: t5_alb) (ds_dn0 :: (t6_ale, t7_alf)) ->
          case ds_dn0 of wild_B1 { (y_ag5, z_ag7) ->
          (case w_soy
           of wild1_XO { (a1_1_akE, a2_1_akG, a3_1_akI, a4_1_akK, a5_1_akM)
 ->
           a2_1_akG x_ag3 y_ag5
           },
           case w1_soz
           of wild1_XO { (a1_2_ako, a2_2_akq, a3_2_aks, a4_2_aku, a5_2_akw)
 ->
           a2_2_akq x_ag3 z_ag7
           })
          },
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2346#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to