Strange compilation behavior

Chad Scherrer chad.scherrer at gmail.com
Sun Dec 9 18:29:53 EST 2007


Hello,

I'm using ghc 6.6.1 under Ubuntu Gutsy on a Pentium 4 machine, and I
was working to get some code running in an acceptable time. I was
surprised to find that turning on profiling switches made the code run
over 40x faster!

Here's the first run, using ghc --make -O2:
88.03user 0.08system 1:28.16elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+13517minor)pagefaults 0swaps

And with ghc --make -O2 -prof -auto-all:
2.33user 0.07system 0:02.41elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+17712minor)pagefaults 0swaps

Otherwise everything is the same! Is this something anyone else has
run into? I'm not sure if it might have been fixed in 6.8.1, but
something funny is going on here.

Thanks,
Chad


More information about the Glasgow-haskell-users mailing list