summaryrefslogtreecommitdiff
path: root/benchmarks/hs/bench-program.hs
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/hs/bench-program.hs')
-rw-r--r--benchmarks/hs/bench-program.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmarks/hs/bench-program.hs b/benchmarks/hs/bench-program.hs
new file mode 100644
index 0000000..e1169ee
--- /dev/null
+++ b/benchmarks/hs/bench-program.hs
@@ -0,0 +1,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)
+ ]