Runhaskell performance anomaly
I'm trying to understand a performance anomaly being observed when running a program under `runhaskell`.

The program in question is:

    isFactor n = (0 ==) . (mod n)
    factors x = filter (isFactor x) [2..x]
    main = putStrLn $ show $ sum $ factors 10000000

When I run this, it takes 1.18 seconds.

However, if I redefine `isFactor` as:

    isFactor n f = (0 ==) (mod n f)

then the program takes 17.7 seconds.

That's a huge difference in performance and I would expect the programs to be equivalent. Does anybody know what I'm missing here?

Note: This doesn't happen when compiled under GHC.


Runhaskell performance anomaly
===

I'm trying to understand a performance anomaly being observed when running a program under `runhaskell`.

The program in question is:

    isFactor n = (0 ==) . (mod n)
    factors x = filter (isFactor x) [2..x]
    main = putStrLn $ show $ sum $ factors 10000000

When I run this, it takes 1.18 seconds.

However, if I redefine `isFactor` as:

    isFactor n f = (0 ==) (mod n f)

then the program takes 17.7 seconds.

That's a huge difference in performance and I would expect the programs to be equivalent. Does anybody know what I'm missing here?

Note: This doesn't happen when compiled under GHC.

