#3629: Code compiled WITHOUT profiling many times slower than compiled WITH
profiling on
---------------------------+------------------------------------------------
  Reporter:  gchrupala     |          Owner:                  
      Type:  bug           |         Status:  new             
  Priority:  normal        |      Milestone:  6.12 branch     
 Component:  Compiler      |        Version:  6.13            
Resolution:                |       Keywords:                  
Difficulty:  Unknown       |             Os:  Unknown/Multiple
  Testcase:                |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |  
---------------------------+------------------------------------------------
Changes (by aruiz):

 * cc: aruiz (added)
  * failure:  => None/Unknown

Comment:

 I have a similar problem using foreign calls (in the hmatrix library). A
 program is 10x slower without profiling (and in ghci) than compiled with
 profiling on.
 This happens in ghc-6.12.1 (ghc-6.12.1-i386-unknown-linux-n.tar.bz2 on
 Ubuntu ), but not in ghc-6.10. I include a small test case.

 We need:

 $ sudo apt-get install libgsl0-dev liblapack-dev

 $ cabal install hmatrix -p

 $ cat slow.hs

 {{{
 import Numeric.LinearAlgebra

 m = ident 2000 :: Matrix Double

 main = print $ vectorMax (takeDiag (m <> m))
 }}}

 With ghc-6.12.1

 {{{

 $ ghc -V
 The Glorious Glasgow Haskell Compilation System, version 6.12.1

 $ ghc --make slow.hs -fforce-recomp
 [1 of 1] Compiling Main             ( slow.hs, slow.o )
 Linking slow ...

 $ time ./slow
 1.0

 real    1m15.790s
 user    1m15.489s
 sys     0m0.228s

 $ ghc --make slow.hs -prof -fforce-recomp
 [1 of 1] Compiling Main             ( slow.hs, slow.o )
 Linking slow ...

 $ time ./slow
 1.0

 real    0m7.366s
 user    0m7.264s
 sys     0m0.100s

 }}}

 With ghc-6.10.3

 {{{

 $ ghc -V
 The Glorious Glasgow Haskell Compilation System, version 6.10.3

 $ ghc --make slow.hs -fforce-recomp
 [1 of 1] Compiling Main             ( slow.hs, slow.o )
 Linking slow ...

 $ time ./slow
 1.0

 real    0m7.142s
 user    0m7.060s
 sys     0m0.072s

 $ ghc --make slow.hs -prof -fforce-recomp
 [1 of 1] Compiling Main             ( slow.hs, slow.o )
 Linking slow ...

 $ time ./slow
 1.0

 real    0m7.242s
 user    0m7.132s
 sys     0m0.096s

 }}}

 Thanks,

 Alberto Ruiz

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3629#comment:3>
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