adjust benchmark

This commit is contained in:
Csaba Hruska 2017-08-04 10:22:31 +02:00
parent ec097859e3
commit a93e578373
4 changed files with 19 additions and 13 deletions

1
bench.sh Executable file
View File

@ -0,0 +1 @@
stack bench --benchmark-arguments '--output=$benchmark.html'

View File

@ -1,5 +1,5 @@
main =
n13 <- sum 0 1 100000
n13 <- sum 0 1 10000
intPrint n13
sum n29 n30 n31 =

View File

@ -1,5 +1,5 @@
main = t1 <- store (CInt 1)
t2 <- store (CInt 100000)
t2 <- store (CInt 10000)
t3 <- store (Fupto t1 t2)
t4 <- store (Fsum t3)
(CInt i') <- eval t4

View File

@ -5,17 +5,22 @@ import Criterion.Main
import Eval
fact :: Integer -> Integer
fact 1 = 1
fact n = n * fact (n - 1)
main :: IO ()
main = do
defaultMainWith
defaultConfig
[ bench "sum_opt" $ nfIO $ eval' PureReducer "grin/sum_opt.grin"
, bench "sum_opt" $ nfIO $ eval' STReducer "grin/sum_opt.grin"
, bench "do" $ nfIO $ eval' PureReducer "grin/do.grin"
, bench "do" $ nfIO $ eval' STReducer "grin/do.grin"
defaultMainWith defaultConfig
[ bgroup "Pure"
[ bench "sum_simple" $ nfIO $ eval' PureReducer "grin/sum_simple.grin"
, bench "sum_opt" $ nfIO $ eval' PureReducer "grin/sum_opt.grin"
]
, bgroup "ST"
[ {-bench "sum_simple" $ nfIO $ eval' STReducer "grin/sum_simple.grin"
, -}bench "sum_opt" $ nfIO $ eval' STReducer "grin/sum_opt.grin"
]
{-
, bgroup "Other"
[ bench "do/pure" $ nfIO $ eval' PureReducer "grin/do.grin"
-- , bench "do/st" $ nfIO $ eval' STReducer "grin/do.grin"
]
-}
]