#2252: Extreme performance degradation on minor code change
-------------------------------+--------------------------------------------
Reporter: simona | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.8.2 | Severity: normal
Keywords: | Testcase:
Architecture: x86_64 (amd64) | Os: Linux
-------------------------------+--------------------------------------------
The attached code runs two similar calculations (call them '''a''' and
'''b''') 1000 times. If I calculate '''a''' and then '''b''' and then do
the same 1000 times again the code runs in:
{{{
time ./tests/BadPerform
real 0m40.429s
user 0m40.360s
sys 0m0.054s
}}}
If I run '''a''' 1000 times, then '''b''' 1000 times, the code runs in:
{{{
time ./tests/GoodPerform
real 0m0.083s
user 0m0.081s
sys 0m0.001s
}}}
These are the times for ghc 6.6.1. For ghc 6.8.2, the first time reduces
to 34s and the second time is identical.
Reproducing this bug is a bit involved: My program links to glpk which in
turn uses gmp. Thus, you would have to:
* install GLPK somewhere
* extract the attached `sparsePolyhedra-0.1.0` cabal package
* create a local copy of `libgmp` and `libglpk` in which all symbols
containing '''gmp''' are renamed to '''mygmp'''
* `cd` to `sparsePolyhedra-0.1.0`
* in `genLibs.sh` change the paths containing
`/users/absint/simona/local/lib` to where you installed GMP and GLPK
* run `genLibs.sh` which will create local copies of
* in `sparsePolyhedra.cabal` change the path
`/users/absint/simona/current/source/sparseDomain` to the current
directory
* build and register the cabal package
* compile the attached `BadPerform.hs` and `GoodPerform.hs`
I guess this is quite complicated. I could send you the IM Core of these
two files instead, if that helps.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2252>
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