[jhc] some more jhc weirdness
sylvain.nahas at googlemail.com
Fri Mar 20 19:43:38 EDT 2009
I have rewritten the program in my previous mail.
io s n t = do
putStr " of depth "
putStr (show n)
putStr " check: "
putStrLn (show t)
With this workaround, the ghc and jhc generated programs give the same
Let do some speed comparison.
$ ghc --make -O2 -fglasgow-exts -fasm prog.hs -o prog.ghc
$ jhc prog.hs -o prog.jhc
You can get a reference C version, supposedly optimized, here:
$ gcc -pipe -Wall -O3 -fomit-frame-pointer -march=native -lm prog.c -o
below are the results for the third run (to mitigate cache miss effect)
of each program:
$ time ./prog.ghc 17
$ time ./prog.gcc 17
C is faster than GHC Haskell, things are in order.
$ time ./prog.jhc 17
What is wrong with my computer, I wonder? :)
More information about the jhc