#2416: Optimization defeated by merging module into main
-------------------------------+--------------------------------------------
    Reporter:  sedillard       |       Owner:          
        Type:  bug             |      Status:  new     
    Priority:  normal          |   Component:  Compiler
     Version:  6.8.3           |    Severity:  normal  
    Keywords:                  |    Testcase:          
Architecture:  x86_64 (amd64)  |          Os:  Linux   
-------------------------------+--------------------------------------------
 I have a library, `TheModule`, and an application that uses `TheModule`,
 called `Main`. When `TheModule` lives in `TheModule.hs` and `Main` lives
 in `Main.hs`, optimization works as expected. When I copy all of
 `TheModule`'s definitions and all of `Main`'s definitions into `Both.hs`,
 much less optimization occurs, as can be seen from -ddump-simpl, as well
 as the drastic difference in running times.

 The program performs a lot of small matrix-vector multiplications. The
 single command line argument tells how many to do.

 {{{
 time ./Main 1000000
 20.0 :. (59.0 :. (100.0 :. (137.0 :. ())))

 real    0m0.389s
 user    0m0.152s
 sys     0m0.232s

 time ./Both 100000
 20.0 :. (59.0 :. (100.0 :. (137.0 :. ())))

 real    0m3.462s
 user    0m3.368s
 sys     0m0.068s
 }}}

 So that makes Both about 100 times slower. Compiled with -O2 and -fexcess-
 precision

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