Interesting effect of upgrading GHC

Hi guys. I just removed GHC 6.6.1 and installed 6.8.1, and I noticed something rather unexpected. I recompiled an existing program (with -O2), and instead of taking 30 seconds to compile, it took roughly 2 seconds. That's a really serious speedup! o_O Anybody have any idea what might have caused this? (Not, you understand, that I'm complaining! But the release notes say 10-15% faster, not 15,000% faster...) I am also curiose to see whether the compiled code execution speed is better/worse - but the program in question is mainly GUI, so I can't test it with that... Perhaps my Chaos program? ;-)

Hi
I just removed GHC 6.6.1 and installed 6.8.1, and I noticed something rather unexpected. I recompiled an existing program (with -O2), and instead of taking 30 seconds to compile, it took roughly 2 seconds.
In previous releases, certain constructs took O(n^2) time to compile. One that was a particular issue for me was: do return () return () return () Once you got to 100 return ()'s in a row GHC was totally useless, while Yhc and Hugs both had no problems. This particular problem was fixed, and I think a few others were as well - if one of those had tripped you up that may explain the speedup. Thanks Neil

"Neil Mitchell"
I just removed GHC 6.6.1 and installed 6.8.1, and I noticed something rather unexpected. I recompiled an existing program (with -O2), and instead of taking 30 seconds to compile, it took roughly 2 seconds.
In previous releases, certain constructs took O(n^2) time to compile. One that was a particular issue for me was:
I've noticed that largish data structures - in my case, ~20x20 matrices - embedded in code seems to take a surprisingly long time to compile. (I haven't noticed (nor looked for) any speedup with new releases, though.) -k -- If I haven't seen further, it is by standing in the footprints of giants

Not sure if this is the case but if you don't delete the old object files and executable GHC may think that its job is already done and give up early.

On Nov 12, 2007, at 12:19 PM, Andrew Coppin wrote:
Hi guys.
I just removed GHC 6.6.1 and installed 6.8.1, and I noticed something rather unexpected. I recompiled an existing program (with -O2), and instead of taking 30 seconds to compile, it took roughly 2 seconds. That's a really serious speedup! o_O Anybody have any idea what might have caused this? (Not, you understand, that I'm complaining! But the release notes say 10-15% faster, not 15,000% faster...)
One of the main reasons for this is that GHC no longer defaults to compiling via C when -O2 is enabled. In 6.6.1, it would generate C code and then run the C compiler on that, by default. Now, by default, it just generates assembly code directly. Both C and assembly generation are available in both versions (using the -fvia-C and -fasm flags, respectively) but 6.8.1 improved the assembly backend enough that it made sense to make it the default. Aaron
participants (5)
-
Aaron Tomb
-
Andrew Coppin
-
Ketil Malde
-
Neil Mitchell
-
Roel van Dijk