2018-03-08 03:34:20 +03:00
|
|
|
module Main where
|
|
|
|
|
|
|
|
import Criterion.Main
|
|
|
|
import Semantic.Util
|
|
|
|
import Data.Monoid
|
2018-03-08 03:56:54 +03:00
|
|
|
import Control.Monad
|
2018-03-08 03:34:20 +03:00
|
|
|
|
|
|
|
pyEval :: FilePath -> Benchmarkable
|
2018-03-08 18:13:26 +03:00
|
|
|
pyEval = whnfIO . fmap show . evaluatePythonFile . ("bench/bench-fixtures/python/" <>)
|
2018-03-08 03:34:20 +03:00
|
|
|
|
2018-03-08 03:47:23 +03:00
|
|
|
rbEval :: FilePath -> Benchmarkable
|
2018-03-08 18:13:26 +03:00
|
|
|
rbEval = whnfIO . fmap show . evaluateRubyFile . ("bench/bench-fixtures/ruby/" <>)
|
2018-03-08 03:34:20 +03:00
|
|
|
|
|
|
|
main :: IO ()
|
2018-03-08 03:47:23 +03:00
|
|
|
main = defaultMain
|
|
|
|
[ bgroup "python" [ bench "assignment" $ pyEval "simple-assignment.py"
|
2018-03-08 03:34:20 +03:00
|
|
|
, bench "function def" $ pyEval "function-definition.py"
|
|
|
|
, bench "if + function calls" $ pyEval "if-statement-functions.py"
|
|
|
|
]
|
2018-03-08 03:47:23 +03:00
|
|
|
, bgroup "ruby" [ bench "assignment" $ rbEval "simple-assignment.rb"
|
|
|
|
, bench "function def" $ rbEval "function-definition.rb"
|
|
|
|
, bench "if + function calls" $ rbEval "if-statement-functions.rb"
|
|
|
|
]
|
2018-03-08 03:34:20 +03:00
|
|
|
]
|