How bad is the PowerPC backend?

Tim Chevalier catamorphism at gmail.com
Mon Feb 9 15:16:22 EST 2009


Hello,
For obscure reasons, I'm running some benchmarks both on an x86
machine (2.20 Ghz, 2 GB of RAM, Linux 2.6.22-15) and on a PowerPC Mac
(1 Ghz, 512 MB of RAM, Mac OS 10.5). I noticed that even some pretty
simple programs run much slower on the Mac than on the PC. For
example, the following program (edited down from the "life" nofib
benchmark):

-------------------------------------------------
limit xs = go [] xs
go acc (x:y:xs) | x==y = acc ++ [x]
                | otherwise = go (acc ++ [x]) (y:xs)
go acc [x] = acc ++ [x]
go acc []  = error "limit"

main = print (length (limit (iterate (\ x -> if x == 10000 then x else
(x+1)) 1)))
---------------------------------------------------

runs in about 1.5 seconds on the PC, and 14 seconds on the Mac. This
is with ghc -O2, version 6.10.1. The numbers are about the same on
either machine whether I use -fvia-C or -fasm. The Mac does have a lot
less RAM, but I can see that the program isn't swapping.

So is the PPC backend really this bad, or should I be looking for
something weird with the hardware or configuration on the Mac?

Thanks,
Tim

-- 
Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt
"I don't like your I-can-use-anything-as-an-adjective attitude."  -- Larry Wall


More information about the Glasgow-haskell-users mailing list