#2486: Code specialization regression in 6.8.3
-----------------------------------------+----------------------------------
Reporter: dolio | Owner:
Type: run-time performance bug | Status: new
Priority: normal | Component: Compiler
Version: 6.8.3 | Severity: normal
Keywords: | Testcase:
Architecture: x86_64 (amd64) | Os: Linux
-----------------------------------------+----------------------------------
Greetings.
I'd recently heard rumblings about the "recursive" benchmark on the
shootout not being great for functional languages, so I thought I'd look
at the Haskell version to see if it could be improved at all. Much to my
surprise, it ran very slowly on 6.8.3 (much slower than on the shootout
site, which uses 6.8.2). I'll attach the benchmark to this report, as it's
a relatively short test case.
It turns out, the latest GHC is no longer specializing fib and tak to
their Int and Double versions respectively. They are both left fully
polymorphic, complete with dictionary passing and destruction in every
iteration. This causes a factor of 5-7 slowdown.
Here are examples of the differing core for the two versions. First,
6.8.2:
http://www.cs.bris.ac.uk/home/rb6822/Recursive682-core.html
Next 6.8.3:
http://www.cs.bris.ac.uk/home/rb6822/Recursive683-core.html
Which displays quite a difference (The 6.8.3 core almost looks loop
unrolled or some such, leading to giant code).
Adding SPECIALIZE pragmas when compiling with 6.8.3 brings back the 6.8.2
performance (and core), but I think the 6.8.2 behavior is probably more
desirable in this case, if it's possible to get it back.
Cheers.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2486>
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