Code specialization regression in 6.8.3
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:
Next 6.8.3:
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.
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |