[Haskell-cafe] Interesting effect of upgrading GHC

Aaron Tomb atomb at soe.ucsc.edu
Mon Nov 12 16:29:17 EST 2007

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.


More information about the Haskell-Cafe mailing list