Skip to content

Add sepEndBy1, sepEndBy1Rec to benchmarks #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bench/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import Effect.Console (log)
import Effect.Exception (throw)
import Effect.Unsafe (unsafePerformEffect)
import Parsing (Parser, runParser)
import Parsing.Combinators (chainl, chainlRec, chainr, chainrRec, manyTill, manyTillRec, manyTillRec_, manyTill_, sepBy, sepByRec)
import Parsing.Combinators (chainl, chainlRec, chainr, chainrRec, manyTill, manyTillRec, manyTillRec_, manyTill_, sepBy, sepByRec, sepEndBy1, sepEndBy1Rec)
import Parsing.String (anyChar, char, eof, string)
import Parsing.String.Basic (digit)
import Performance.Minibench (benchWith)
Expand Down Expand Up @@ -196,6 +196,12 @@ main = do
htmlTableWrap "runParser sepByRec 10000" $ benchWith 50
$ \_ -> throwLeft $ runParser string23_10000 $ sepByRec anyChar (pure unit)

log "<th><h2>sepEndBy1 10000</h2></th>"
htmlTableWrap "runParser sepEndBy1 10000" $ benchWith 50
$ \_ -> throwLeft $ runParser string23_10000 $ sepEndBy1 anyChar (pure unit)
htmlTableWrap "runParser sepEndBy1Rec 10000" $ benchWith 50
$ \_ -> throwLeft $ runParser string23_10000 $ sepEndBy1Rec anyChar (pure unit)

log "<th><h2>chainl 10000</h2></th>"
htmlTableWrap "runParser chainl 10000" $ benchWith 50
$ \_ -> throwLeft $ runParser string23_10000 $ chainl anyChar (pure const) 'x'
Expand Down