[GHC] #5996: fix for CSE

GHC ghc-devs at haskell.org
Fri Jun 7 22:06:11 CEST 2013


#5996: fix for CSE
---------------------------------+------------------------------------------
    Reporter:  michalt           |       Owner:  simonpj                
        Type:  bug               |      Status:  patch                  
    Priority:  normal            |   Milestone:  7.8.1                  
   Component:  Compiler          |     Version:  7.5                    
    Keywords:                    |          Os:  Unknown/Multiple       
Architecture:  Unknown/Multiple  |     Failure:  Runtime performance bug
  Difficulty:  Unknown           |    Testcase:                         
   Blockedby:                    |    Blocking:                         
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by igloo):

 I get very different nofib (mode=slow) results to you, using recent HEAD:
 {{{
 --------------------------------------------------------------------------------
         Program           Size    Allocs   Runtime   Elapsed  TotalMem
 --------------------------------------------------------------------------------
 [...]
            ansi          -1.1%     +9.4%    +10.1%    +10.1%     +0.0%
 [...]
        compress          -0.5%     -0.0%      0.10      0.10    -33.3%
 [...]
             Min          -2.2%     -1.3%     -6.6%     -7.1%    -33.3%
             Max          -0.4%     +9.4%    +10.1%    +10.1%     +1.7%
  Geometric Mean          -0.6%     +0.1%     +0.5%     +0.5%     -0.4%
 }}}
 I took a look at the ansi test. `Main.hs` is a boiled down version of it.
 Compiling with
 {{{
 ghc -O2 -rtsopts --make Main -fforce-recomp
 }}}
 and running with
 {{{
 time ./Main 1400 +RTS -t < /dev/null > out
 }}}
 I get
 {{{
 <<ghc: 15797996408 bytes, 24864 GCs, 512598/945104 avg/max bytes residency
 (70 samples), 3M in use, 0.00 INIT (0.00 elapsed), 1.82 MUT (1.82
 elapsed), 2.08 GC (2.08 elapsed) :ghc>>
 ./Main 1400 +RTS -t < /dev/null > out  3.88s user 0.03s system 99% cpu
 3.907 total
 }}}
 for HEAD, and
 {{{
 <<ghc: 16996446952 bytes, 27034 GCs, 536827/955856 avg/max bytes residency
 (75 samples), 3M in use, 0.00 INIT (0.00 elapsed), 1.95 MUT (1.95
 elapsed), 2.64 GC (2.64 elapsed) :ghc>>
 ./Main 1400 +RTS -t < /dev/null > out  4.56s user 0.03s system 99% cpu
 4.594 total
 }}}
 with this patch.

 I believe the difference is ultimately caused by the expression
 {{{
 loop 0 ""
 }}}
 which appears in the program twice.

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



More information about the ghc-tickets mailing list