[Haskell-cafe] GHC vs GCC

wren ng thornton wren at freegeek.org
Sat Mar 27 02:50:45 EDT 2010

David Menendez wrote:
> On Sat, Mar 27, 2010 at 12:56 AM, Thomas DuBuisson
> <thomas.dubuisson at gmail.com> wrote:
>>> Using bang patterns didn't help almost anything here. Using rem
>>> instead of mod made the time go from 45s to 40s. Now, using -fvia-C
>>> really helped (when I used rem but not using mod). It went down to
>>> 10s.
>> Bang patterns should have helped tons - it isn't GHC thats at fault
>> here and yes it does tco.  I attached a version w/ excessive bangs
>> below.  Did you compile with "ghc --make -O3 -fforce-recomp"?
> Does -O3 actually do anything? GHC only goes up to -O2.

Well GHC has an -O3[1], but it's not a good idea to use it. Some of the 
"optimizations" that -O3 does can result in slower code for particular 
programs. Whereas -O2 is safe and never results in pessimizations.

[1] Unless recent versions have removed it.

Live well,

More information about the Haskell-Cafe mailing list