Re: [Haskell-cafe] benchmarking a function that returns an unlifted type

The critical feature of whnf (as I understand it) is that GHC does not use
the static argument transformation. The function passed to "go" therefore
doesn't inline into it. So you'll have to write your version in some
fashion that similarly prevents undesirable inlining. Could you just copy
the code and specialize it to the desired type?
On Mar 18, 2017 1:32 PM, "Richard Eisenberg"
main :: IO () main = do initializeTime let lifted = whnf fastSumPrimes 100000
unlifted = Benchmarkable go where go n | n <= 0 = return () | otherwise = let x = fastSumPrimes# 100000# in go (n-1)
benchmark lifted benchmark unlifted
I've tried increasing the argument in the unlifted case, to no avail. I've also tried using `case` instead of `let`. -ddump-simpl suggests that fastSumPrimes# is really being called, but I'm dubious. Can anyone offer advice? Thanks! Richard _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (1)
-
David Feuer