Skip to content

Commit 6181e1c

Browse files
author
linerlock
committed
merge Benchmark-Collection into Benchmark
1 parent 647a937 commit 6181e1c

File tree

3 files changed

+10
-46
lines changed

3 files changed

+10
-46
lines changed

benchmark/Benchmark-Collection.hs

-30
This file was deleted.

benchmark/Benchmark.hs

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ import Control.Applicative
66
import Control.DeepSeq (NFData(rnf))
77
import Criterion.Main
88
import Criterion.Config
9-
import Text.Parsec
10-
import Text.Parsec.ByteString
11-
129
import Language.Egison
1310

1411
runEgisonFile :: String -> IO (Either EgisonError Env)
15-
runEgisonFile path = do
16-
env <- loadPrimitives nullEnv >>= loadLibraries
17-
evalEgisonTopExpr env $ LoadFile path
12+
runEgisonFile path = loadPrimitives nullEnv >>= loadLibraries >>= flip loadEgisonFile path
1813

1914
config :: Config
2015
config = defaultConfig { cfgSamples = ljust 3
2116
, cfgPerformGC = ljust True }
2217

2318
main :: IO ()
24-
main = defaultMainWith config (return ()) [
25-
bgroup "fact" [ bench "30000" $ runEgisonFile "benchmark/fact-30000.egi" ]
26-
]
19+
main = defaultMainWith config (return ())
20+
[ bgroup "fact" [ bench "30000" $ runEgisonFile "benchmark/fact-30000.egi" ]
21+
, bgroup "collection"
22+
[ bench "cons-bench" $ runEgisonFile "benchmark/collection-bench-cons.egi"
23+
, bench "cons-bench-large" $ runEgisonFile "benchmark/collection-bench-cons-large.egi"
24+
, bench "snoc-bench" $ runEgisonFile "benchmark/collection-bench-snoc.egi"
25+
]
26+
]
2727

egison.cabal

+1-7
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ Benchmark benchmark
4646
Type: exitcode-stdio-1.0
4747
Hs-Source-Dirs: benchmark
4848
Main-Is: Benchmark.hs
49-
Build-Depends: egison, base >= 4.0 && < 5, deepseq, criterion >= 0.5, transformers, mtl, parsec >= 3.0
50-
51-
Benchmark benchmark-collection
52-
Type: exitcode-stdio-1.0
53-
Hs-Source-Dirs: benchmark
54-
Main-Is: Benchmark-Collection.hs
55-
Build-Depends: egison, base >= 4.0 && < 5, deepseq, criterion >= 0.5, transformers, mtl, parsec >= 3.0
49+
Build-Depends: egison, base >= 4.0 && < 5, deepseq, criterion >= 0.5, transformers, mtl
5650

5751
Executable egison
5852
Main-is: egisoni.hs

0 commit comments

Comments
 (0)