Skip to content

Commit

Permalink
fix benchmark script
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Feb 22, 2024
1 parent 06593ee commit 754d083
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions benchmarker/benchmarker.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@


import Control.Exception (evaluate)
import qualified Data.Text.IO
import Data.Time (diffUTCTime, getCurrentTime)
import System.Environment (getArgs)
import Toml (parse)
Expand All @@ -11,8 +12,7 @@ main =
filename <- case args of
[filename] -> pure filename
_ -> fail "Usage: benchmarker <file.toml>"
txt <- readFile filename
evaluate (length txt) -- readFile uses lazy IO, force it to load
txt <- Data.Text.IO.readFile filename
start <- getCurrentTime
evaluate (parse txt)
stop <- getCurrentTime
Expand Down
2 changes: 1 addition & 1 deletion toml-parser.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ executable toml-benchmarker
buildable: False
main-is: benchmarker.hs
default-language: Haskell2010
build-depends: base, toml-parser, time
build-depends: base, toml-parser, time, text
hs-source-dirs: benchmarker

0 comments on commit 754d083

Please sign in to comment.