How bad is the PowerPC backend?

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

Hello Tim, Monday, February 9, 2009, 11:16:22 PM, you wrote:
So is the PPC backend really this bad, or should I be looking for something weird with the hardware or configuration on the Mac?
check GC times too. one possibility is that GC takes much more time due to smaller L2 cache -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On 2/9/09, Bulat Ziganshin
Hello Tim,
Monday, February 9, 2009, 11:16:22 PM, you wrote:
So is the PPC backend really this bad, or should I be looking for something weird with the hardware or configuration on the Mac?
check GC times too. one possibility is that GC takes much more time due to smaller L2 cache
Hmm, doesn't seem to be happening with this example. On the Mac, I get (running with +RTS -s -RTS): 11.86 MUT time (13.95s elapsed) 0.08s GC time (0.15s elapsed) %GC time 0.6% (1.1% elapsed) and on the PC: 1.07s MUT time (1.34s elapsed) 0.01s GC time (0.02s elapsed) %GC time 1.1% (1.6% elapsed) so GC doesn't seem to explain the large difference in running times. Cheers, Tim -- Tim Chevalier * http://cs.pdx.edu/~tjc * Often in error, never in doubt "Maybe I don't want to meet someone who shares my interests. I hate my interests." -- Ghost World
participants (2)
-
Bulat Ziganshin
-
Tim Chevalier