Skip to content

Commit

Permalink
Update benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
johnspade committed Mar 30, 2024
1 parent 6305b2b commit 88ac7d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class ParserBenchmark[T] {
// }

@Benchmark
def zioParserRecursive(): Either[zio.parser.Parser.ParserError[String], T] = {
def zioParserRecursive(): Either[zio.parser.ParseFailure[String], T] = {
import zio.parser._
zioSyntax.parseString(value, ParserImplementation.Recursive)
}
Expand All @@ -58,7 +58,7 @@ abstract class ParserBenchmark[T] {
}

@Benchmark
def zioParserOpStack(): Either[zio.parser.Parser.ParserError[String], T] = {
def zioParserOpStack(): Either[zio.parser.ParseFailure[String], T] = {
import zio.parser._
zioSyntax.parseString(value, ParserImplementation.StackSafe)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.openjdk.jmh.annotations.{
}
import zio.Chunk
import zio.parser.{ParserImplementation, Syntax}
import zio.parser.ParseFailure
import zio.parser.Parser.ParserError
import zio.parser.internal.Debug

Expand Down Expand Up @@ -50,19 +51,19 @@ class LuceneQueryBenchmark {
catsParser.query.parseAll(testQuery)

@Benchmark
def zioParse(): Either[ParserError[String], Query] =
def zioParse(): Either[ParseFailure[String], Query] =
zioParserQuery.parseString(testQuery)

@Benchmark
def zioParseStrippedRecursive(): Either[ParserError[String], Query] =
def zioParseStrippedRecursive(): Either[ParseFailure[String], Query] =
zioParserStrippedQuery.parseString(testQuery, ParserImplementation.Recursive)

@Benchmark
def zioParseStrippedRecursiveChunk(): Either[ParserError[String], Query] =
zioParserStrippedQuery.parseChunk(testQueryChunk)

@Benchmark
def zioParseStrippedOpStack(): Either[ParserError[String], Query] =
def zioParseStrippedOpStack(): Either[ParseFailure[String], Query] =
zioParserStrippedQuery.parseString(testQuery, ParserImplementation.StackSafe)

// @Benchmark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.openjdk.jmh.annotations.{
Warmup
}
import zio.Chunk
import zio.parser.ParseFailure
import zio.parser.Parser.ParserError
import zio.parser.{Regex, Syntax}

Expand Down Expand Up @@ -68,23 +69,23 @@ class CharParserMicroBenchmarks {
}

@Benchmark
def skipAndTransform(): Either[ParserError[Nothing], String] =
def skipAndTransform(): Either[ParseFailure[Nothing], String] =
skipAndTransformSyntax.parseChars(hello)

@Benchmark
def skipAndTransformOrElse(): Either[ParserError[String], String] =
def skipAndTransformOrElse(): Either[ParseFailure[String], String] =
skipAndTransformOrElseSyntax.parseChars(world)

@Benchmark
def skipAndTransformRepeat(): Either[ParserError[String], Chunk[String]] =
def skipAndTransformRepeat(): Either[ParseFailure[String], Chunk[String]] =
skipAndTransformRepeatSyntax.parseChars(hellos)

@Benchmark
def skipAndTransformZip(): Either[ParserError[String], String10] =
def skipAndTransformZip(): Either[ParseFailure[String], String10] =
skipAndTransformZipSyntax.parseChars(hellos)

@Benchmark
def repeatWithSep0(): Either[ParserError[String], Chunk[String]] =
def repeatWithSep0(): Either[ParseFailure[String], Chunk[String]] =
repeatWithSep0Syntax.parseString(hellosSep)
}

Expand Down

0 comments on commit 88ac7d3

Please sign in to comment.