[QuickCheck] [PATCH] Fix a performance issue

Simon Hengel sol at typeful.net
Sun Nov 18 14:09:04 GMT 2012


Hi,
here are the numbers.

Without producing any output:

    -- file main.hs
    main = replicateM_ 100 . (quickCheckWith stdArgs {chatty = False}) $
      \x y -> x /= y ==> x /= (y :: Int)

    $ ghc main.hs && time ./main
    real    0m0.851s
    user    0m0.844s
    sys     0m0.008s


QuickCheck's current default behavior:

    -- file main.hs
    main = replicateM_ 100 . quickCheck $
      \x y -> x /= y ==> x /= (y :: Int)

    $ ghc main.hs && time ./main
    real    0m6.650s
    user    0m1.940s
    sys     0m2.404s


QuickCheck's default behavior with my patch:

    real    0m1.697s
    user    0m1.088s
    sys     0m0.132s

I hope it is obvious how to interpret this.

The solution was pointed out by parcs in a comment to GHC #7418 [1].

Cheers,
Simon

[1] http://hackage.haskell.org/trac/ghc/ticket/7418#comment:1



More information about the QuickCheck mailing list