a compiled program is slower than byte code
Kazu Yamamoto ( 山本和彦 )
kazu at iij.ad.jp
Wed Feb 9 05:35:03 CET 2011
Hello Simon,
> $ ghc-nightly2 ./kazu.hs -O2 -fforce-recomp; time ./kazu
> [1 of 1] Compiling Main ( kazu.hs, kazu.o )
> Linking kazu ...
> 4.17s real 4.16s user 0.01s system 99% ./kazu
OK. I ran it on 32bit Linux.
6.12.3 runghc -- 2.22s user 0.40s system 96% cpu 2.724 total
ghc -- 1.96s user 0.14s system 97% cpu 2.151 total
ghc -O -- 2.18s user 0.10s system 97% cpu 2.333 total
ghc -O2 -- 2.27s user 0.07s system 97% cpu 2.393 total
ghc-7.0 runghc -- 3.43s user 0.35s system 97% cpu 3.861 total
ghc -- 5.11s user 0.07s system 97% cpu 5.299 total
ghc -O -- 5.38s user 0.03s system 97% cpu 5.534 total
ghc -O2 -- 5.54s user 0.10s system 97% cpu 5.783 total
ghc-7.0 is slower than 6.12.3. And if the code is compiled with
ghc-7.0, it is slower than runghc.
> HEAD is more than twice as fast on this program. Fusion not working,
> perhaps?
Here is the results of "ghc -O -ddump-simpl-stats":
ghc-7.0:
19 RuleFired
6 ++
2 <=#
1 fold/build
5 foldr/app
1 foldr/augment
1 foldr/single
1 map
1 unpack
1 unpack-list
6.12.3:
25 RuleFired
6 ++
2 <=#
3 fold/build
6 foldr/app
1 foldr/augment
1 map
2 repeat
2 take
1 unpack
1 unpack-list
They are exactly the same on Linux and Mac.
--Kazu
More information about the Glasgow-haskell-users
mailing list