2014-08-27 23:54:31 +02:00
|
|
|
module ParserBench (benchmarks) where
|
|
|
|
|
2019-03-17 22:47:38 +01:00
|
|
|
import Nix.Parser
|
2014-08-27 23:54:31 +02:00
|
|
|
|
2019-03-17 22:47:38 +01:00
|
|
|
import Control.Applicative
|
|
|
|
import Criterion
|
2014-08-27 23:54:31 +02:00
|
|
|
|
|
|
|
benchFile :: FilePath -> Benchmark
|
|
|
|
benchFile = bench <*> whnfIO . parseNixFile . ("data/" ++)
|
|
|
|
|
|
|
|
benchmarks :: Benchmark
|
2019-03-17 22:47:38 +01:00
|
|
|
benchmarks = bgroup
|
|
|
|
"Parser"
|
2014-08-27 23:54:31 +02:00
|
|
|
[ benchFile "nixpkgs-all-packages.nix"
|
|
|
|
, benchFile "nixpkgs-all-packages-pretty.nix"
|
|
|
|
, benchFile "let-comments.nix"
|
|
|
|
, benchFile "let-comments-multiline.nix"
|
|
|
|
, benchFile "let.nix"
|
|
|
|
, benchFile "simple.nix"
|
|
|
|
, benchFile "simple-pretty.nix"
|
|
|
|
]
|