Wed Sep  3 05:02:28 PDT 2008  [EMAIL PROTECTED]
  * Major change in compilation of instance declarations (fix Trac #955, #2328)
  
  This patch makes an important change to the way that dictionary
  functions are handled.  Before, they were unconditionally marked
  INLIINE, but all the code written by the user in the instance
  was inside that unconditionally-inlined function.  Result: massive
  code bloat in programs that use complicated instances.
  
  This patch make instances behave rather as if all the methods
  were written in separate definitions.  That dramatically reduces
  bloat.  The new plan is described in TcInstDcls
        Note [How instance declarations are translated]
  
  Everything validates.  The major code-bloat bug is squashed: in particular
  DoCon is fine now (Trac #2328) and I believe that #955 is also better.
  
  Nofib results:
  
  Binary sizes
          -1 s.d.      +2.5%
          +1 s.d.      +3.1%
          Average      +2.8%
  
  Allocations
          -1 s.d.      -6.4%
          +1 s.d.      +2.5%
          Average      -2.0%
  
  Note that 2% improvement.  Some programs improve by 20% (rewrite)!
  Two get slightly worse: pic (2.1%), and gameteb (3.2%), but all others
  improve or stay the same.
  
  I am not absolutely 100% certain that all the corners are correct; for
  example, when default methods are marked INLINE, are they inlined?  But
  overall it's better.
  
  It's nice that the patch also removes a lot of code.  I deleted some
  out of date comments, but there's something like 100 fewer lines of
  code in the new version!  (In the line counts below, there are a lot
  of new comments.)
  

    M ./compiler/deSugar/DsBinds.lhs -2 +5
    M ./compiler/hsSyn/HsBinds.lhs -1 +1
    M ./compiler/typecheck/TcArrows.lhs -6 +1
    M ./compiler/typecheck/TcBinds.lhs -12 +20
    M ./compiler/typecheck/TcClassDcl.lhs -353 +115
    M ./compiler/typecheck/TcExpr.lhs -29 +29
    M ./compiler/typecheck/TcExpr.lhs-boot -1 +1
    M ./compiler/typecheck/TcInstDcls.lhs -268 +281
    M ./compiler/typecheck/TcMType.lhs -16 +15
    M ./compiler/typecheck/TcMatches.lhs -9 +9
    M ./compiler/typecheck/TcType.lhs -10 +18
    M ./compiler/typecheck/TcUnify.lhs -18 +37

View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20080903120228-1287e-86f27384345a9f88b39f4033dd07c8981db3968f.gz

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to