summaryrefslogtreecommitdiff
path: root/benchmarks/hs/bench-program.hs
blob: e1169eefa1e8f726cda113182cf0d495f37f5e87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import qualified Criterion.Main             as Crit
import qualified Data.Graph.Dynamic.Levels  as Levels
import qualified Data.Graph.Dynamic.Program as Program
import qualified Data.Text.Lazy.IO          as TL

main :: IO ()
main = do
    errOrProgram <- Program.decodeProgram Program.decodeInt <$> TL.getContents

    Crit.defaultMain
        [ Crit.env (either fail return errOrProgram) $ \program -> Crit.bench "levels" $ Crit.nfIO $ do
            levels <- Levels.empty'
            Program.runProgram levels (program :: Program.Program Int)
        ]