diff --git a/benchmark-jsoniter-scala-vs-simdjson-java.sh b/benchmark-jsoniter-scala-vs-simdjson-java.sh new file mode 100755 index 000000000..2f901d64b --- /dev/null +++ b/benchmark-jsoniter-scala-vs-simdjson-java.sh @@ -0,0 +1,3 @@ +#!/bin/bash +sbt -java-home /usr/lib/jvm/jdk-24 ++3.6.1 jsoniter-scala-benchmarkJVM/clean 'jsoniter-scala-benchmarkJVM/jmh:run -p size=1,10,100,1000,10000,100000,1000000 (ArrayOf(Boolean|Byte|Double|Float|Int|Long|Short)s|StringOf(Ascii|Escaped|NonAscii)Chars)Reading.(jsoniterScala|simdjsonJava)' 2>&1 | tee jsoniter-scala-vs-simdjson-java.txt +sbt -java-home /usr/lib/jvm/jdk-24 ++3.6.1 jsoniter-scala-benchmarkJVM/clean 'jsoniter-scala-benchmarkJVM/jmh:run -t 16 -p size=1,10,100,1000,10000,100000,1000000 (ArrayOf(Boolean|Byte|Double|Float|Int|Long|Short)s|StringOf(Ascii|Escaped|NonAscii)Chars)Reading.(jsoniterScala|simdjsonJava)' 2>&1 | tee jsoniter-scala-vs-simdjson-java-t16.txt \ No newline at end of file diff --git a/build.sbt b/build.sbt index abbfcf89b..43ecbf616 100644 --- a/build.sbt +++ b/build.sbt @@ -256,6 +256,7 @@ lazy val `jsoniter-scala-benchmark` = crossProject(JVMPlatform, JSPlatform) "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.18.0", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.18.0", "com.fasterxml.jackson.module" % "jackson-module-blackbird" % "2.18.0", + "org.simdjson" % "simdjson-java" % "0.3.0", "org.openjdk.jmh" % "jmh-core" % "1.37", "org.openjdk.jmh" % "jmh-generator-asm" % "1.37", "org.openjdk.jmh" % "jmh-generator-bytecode" % "1.37", @@ -276,6 +277,10 @@ lazy val `jsoniter-scala-benchmark` = crossProject(JVMPlatform, JSPlatform) lazy val `jsoniter-scala-benchmarkJVM` = `jsoniter-scala-benchmark`.jvm .enablePlugins(JmhPlugin) + .settings( + Test / fork := true, + Test / javaOptions ++= Seq("--add-modules", "jdk.incubator.vector") + ) lazy val assemblyJSBenchmarks = sys.props.get("assemblyJSBenchmarks").isDefined diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReadingSpec.scala index 2623de137..42c819d37 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReadingSpec.scala @@ -18,6 +18,7 @@ class ArrayOfBooleansReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -36,6 +37,7 @@ class ArrayOfBooleansReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReadingSpec.scala index 25a71b2cc..3a69a8acb 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReadingSpec.scala @@ -18,6 +18,7 @@ class ArrayOfBytesReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -36,6 +37,7 @@ class ArrayOfBytesReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReadingSpec.scala index 2b0eac3d3..890f6cf55 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReadingSpec.scala @@ -18,6 +18,7 @@ class ArrayOfDoublesReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -36,6 +37,7 @@ class ArrayOfDoublesReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReadingSpec.scala index 977176100..1ae8db2d1 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReadingSpec.scala @@ -29,6 +29,7 @@ class ArrayOfFloatsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -47,6 +48,7 @@ class ArrayOfFloatsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReadingSpec.scala index 4039737c1..7290aa028 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReadingSpec.scala @@ -18,6 +18,7 @@ class ArrayOfIntsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -36,6 +37,7 @@ class ArrayOfIntsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReadingSpec.scala index a62aefabd..475d253ca 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReadingSpec.scala @@ -18,6 +18,7 @@ class ArrayOfLongsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -36,6 +37,7 @@ class ArrayOfLongsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReadingSpec.scala index 8a0a018b8..aa7159f1a 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReadingSpec.scala @@ -18,6 +18,7 @@ class ArrayOfShortsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -36,6 +37,7 @@ class ArrayOfShortsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReadingSpec.scala index aac6adb5a..49df0949e 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReadingSpec.scala @@ -19,6 +19,7 @@ class StringOfAsciiCharsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -38,6 +39,7 @@ class StringOfAsciiCharsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReadingSpec.scala index 9e5fe5855..b0aa60c92 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReadingSpec.scala @@ -19,6 +19,7 @@ class StringOfEscapedCharsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -38,6 +39,7 @@ class StringOfEscapedCharsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReadingSpec.scala b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReadingSpec.scala index 3134f0eb5..d605f3468 100644 --- a/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReadingSpec.scala +++ b/jsoniter-scala-benchmark/jvm/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReadingSpec.scala @@ -19,6 +19,7 @@ class StringOfNonAsciiCharsReadingSpec extends BenchmarkSpecBase { benchmark.jsoniterScala() shouldBe benchmark.obj benchmark.playJson() shouldBe benchmark.obj benchmark.playJsonJsoniter() shouldBe benchmark.obj + benchmark.simdjsonJava() shouldBe benchmark.obj benchmark.smithy4sJson() shouldBe benchmark.obj benchmark.sprayJson() shouldBe benchmark.obj benchmark.uPickle() shouldBe benchmark.obj @@ -38,6 +39,7 @@ class StringOfNonAsciiCharsReadingSpec extends BenchmarkSpecBase { intercept[Throwable](b.jsoniterScala()) intercept[Throwable](b.playJson()) intercept[Throwable](b.playJsonJsoniter()) + intercept[Throwable](b.simdjsonJava()) intercept[Throwable](b.smithy4sJson()) intercept[Throwable](b.sprayJson()) intercept[Throwable](b.uPickle()) diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReading.scala index ed42c983f..c2e8115cd 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBooleansReading.scala @@ -77,6 +77,10 @@ class ArrayOfBooleansReading extends ArrayOfBooleansBenchmark { readFromArray(jsonBytes).as[Array[Boolean]] } + @Benchmark + def simdjsonJava(): Array[Boolean] = + simdJsonParser.get.parse[Array[Boolean]](jsonBytes, jsonBytes.length, classOf[Array[Boolean]]) + @Benchmark def smithy4sJson(): Array[Boolean] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReading.scala index 5f793ca43..a2079edb4 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfBytesReading.scala @@ -79,6 +79,10 @@ class ArrayOfBytesReading extends ArrayOfBytesBenchmark { readFromArray(jsonBytes).as[Array[Byte]] } + @Benchmark + def simdjsonJava(): Array[Byte] = + simdJsonParser.get.parse[Array[Byte]](jsonBytes, jsonBytes.length, classOf[Array[Byte]]) + @Benchmark def smithy4sJson(): Array[Byte] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReading.scala index 16789627e..09bf8fc02 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfDoublesReading.scala @@ -78,6 +78,10 @@ class ArrayOfDoublesReading extends ArrayOfDoublesBenchmark { readFromArray(jsonBytes).as[Array[Double]] } + @Benchmark + def simdjsonJava(): Array[Double] = + simdJsonParser.get.parse[Array[Double]](jsonBytes, jsonBytes.length, classOf[Array[Double]]) + @Benchmark def smithy4sJson(): Array[Double] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReading.scala index 3c9f95287..cf44696d5 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfFloatsReading.scala @@ -79,6 +79,10 @@ class ArrayOfFloatsReading extends ArrayOfFloatsBenchmark { readFromArray[play.api.libs.json.JsValue](jsonBytes).as[Array[Float]] } + @Benchmark + def simdjsonJava(): Array[Float] = + simdJsonParser.get.parse[Array[Float]](jsonBytes, jsonBytes.length, classOf[Array[Float]]) + @Benchmark def smithy4sJson(): Array[Float] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReading.scala index 8820da1e4..cfb534702 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfIntsReading.scala @@ -78,6 +78,10 @@ class ArrayOfIntsReading extends ArrayOfIntsBenchmark { readFromArray(jsonBytes).as[Array[Int]] } + @Benchmark + def simdjsonJava(): Array[Int] = + simdJsonParser.get.parse[Array[Int]](jsonBytes, jsonBytes.length, classOf[Array[Int]]) + @Benchmark def smithy4sJson(): Array[Int] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReading.scala index ea9b41b6a..ece4a34f8 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfLongsReading.scala @@ -78,6 +78,10 @@ class ArrayOfLongsReading extends ArrayOfLongsBenchmark { readFromArray(jsonBytes).as[Array[Long]] } + @Benchmark + def simdjsonJava(): Array[Long] = + simdJsonParser.get.parse[Array[Long]](jsonBytes, jsonBytes.length, classOf[Array[Long]]) + @Benchmark def smithy4sJson(): Array[Long] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReading.scala index 66d65f8f7..09c3a7100 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfShortsReading.scala @@ -78,6 +78,10 @@ class ArrayOfShortsReading extends ArrayOfShortsBenchmark { readFromArray[play.api.libs.json.JsValue](jsonBytes).as[Array[Short]] } + @Benchmark + def simdjsonJava(): Array[Short] = + simdJsonParser.get.parse[Array[Short]](jsonBytes, jsonBytes.length, classOf[Array[Short]]) + @Benchmark def smithy4sJson(): Array[Short] = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReading.scala index be359d131..a0757ddd0 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfAsciiCharsReading.scala @@ -78,6 +78,10 @@ class StringOfAsciiCharsReading extends StringOfAsciiCharsBenchmark { readFromArray[play.api.libs.json.JsValue](jsonBytes, tooLongStringConfig).as[String] } + @Benchmark + def simdjsonJava(): String = + simdJsonParser.get.parse[String](jsonBytes, jsonBytes.length, classOf[String]) + @Benchmark def smithy4sJson(): String = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReading.scala index 23a77bc29..a702657a5 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfEscapedCharsReading.scala @@ -78,6 +78,10 @@ class StringOfEscapedCharsReading extends StringOfEscapedCharsBenchmark { readFromArray[play.api.libs.json.JsValue](jsonBytes, tooLongStringConfig).as[String] } + @Benchmark + def simdjsonJava(): String = + simdJsonParser.get.parse[String](jsonBytes, jsonBytes.length, classOf[String]) + @Benchmark def smithy4sJson(): String = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReading.scala b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReading.scala index ca4fcf8ba..6feaa77c9 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReading.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/benchmark/StringOfNonAsciiCharsReading.scala @@ -78,6 +78,10 @@ class StringOfNonAsciiCharsReading extends StringOfNonAsciiCharsBenchmark { readFromArray[play.api.libs.json.JsValue](jsonBytes, tooLongStringConfig).as[String] } + @Benchmark + def simdjsonJava(): String = + simdJsonParser.get.parse[String](jsonBytes, jsonBytes.length, classOf[String]) + @Benchmark def smithy4sJson(): String = { import com.github.plokhotnyuk.jsoniter_scala.benchmark.Smithy4sJCodecs._ diff --git a/jsoniter-scala-benchmark/shared/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/benchmark/CommonParams.scala b/jsoniter-scala-benchmark/shared/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/benchmark/CommonParams.scala index 1eaa048a7..b03127e43 100644 --- a/jsoniter-scala-benchmark/shared/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/benchmark/CommonParams.scala +++ b/jsoniter-scala-benchmark/shared/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/benchmark/CommonParams.scala @@ -2,6 +2,7 @@ package com.github.plokhotnyuk.jsoniter_scala.benchmark import java.util.concurrent.TimeUnit import org.openjdk.jmh.annotations._ +import org.simdjson.SimdJsonParser @State(Scope.Thread) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @@ -9,10 +10,12 @@ import org.openjdk.jmh.annotations._ @Fork(value = 1, jvmArgs = Array( // "-Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false", // "-XX:+UseTransparentHugePages", + "--add-modules", + "jdk.incubator.vector", "-server", "-noclassgc", - "-Xms2g", - "-Xmx2g", + "-Xms16g", + "-Xmx16g", "-XX:NewSize=1g", "-XX:MaxNewSize=1g", "-XX:InitialCodeCacheSize=512m", @@ -39,4 +42,8 @@ import org.openjdk.jmh.annotations._ )) @BenchmarkMode(Array(Mode.Throughput)) @OutputTimeUnit(TimeUnit.SECONDS) -abstract class CommonParams +abstract class CommonParams { + val simdJsonParser: ThreadLocal[SimdJsonParser] = new ThreadLocal[SimdJsonParser] { + override def initialValue(): SimdJsonParser = new SimdJsonParser + } +} diff --git a/jsoniter-scala-vs-simdjson-java-t16.txt b/jsoniter-scala-vs-simdjson-java-t16.txt new file mode 100644 index 000000000..71df1eb07 --- /dev/null +++ b/jsoniter-scala-vs-simdjson-java-t16.txt @@ -0,0 +1,141 @@ +[info] Benchmark (size) Mode Cnt Score Error Units +[info] ArrayOfBooleansReading.jsoniterScala 1 thrpt 5 167544646.964 ± 3885202.672 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 10 thrpt 5 26988930.681 ± 400845.685 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 100 thrpt 5 3276151.010 ± 1838448.521 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 1000 thrpt 5 300549.864 ± 3813.682 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 10000 thrpt 5 31049.834 ± 778.788 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 100000 thrpt 5 3590.324 ± 76.756 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 1000000 thrpt 5 348.001 ± 8.653 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 1 thrpt 5 13273411.498 ± 710160.077 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 10 thrpt 5 8330445.914 ± 236147.985 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 100 thrpt 5 1258832.719 ± 23290.651 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 1000 thrpt 5 161709.104 ± 7419.364 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 10000 thrpt 5 16007.039 ± 405.433 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 100000 thrpt 5 1564.252 ± 19.430 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 1000000 thrpt 5 146.444 ± 2.244 ops/s +[info] ArrayOfBytesReading.jsoniterScala 1 thrpt 5 172431697.858 ± 815679.450 ops/s +[info] ArrayOfBytesReading.jsoniterScala 10 thrpt 5 22047179.989 ± 114221.087 ops/s +[info] ArrayOfBytesReading.jsoniterScala 100 thrpt 5 2078656.405 ± 94130.355 ops/s +[info] ArrayOfBytesReading.jsoniterScala 1000 thrpt 5 186552.663 ± 4392.758 ops/s +[info] ArrayOfBytesReading.jsoniterScala 10000 thrpt 5 17641.640 ± 356.451 ops/s +[info] ArrayOfBytesReading.jsoniterScala 100000 thrpt 5 1988.966 ± 24.990 ops/s +[info] ArrayOfBytesReading.jsoniterScala 1000000 thrpt 5 198.621 ± 1.968 ops/s +[info] ArrayOfBytesReading.simdjsonJava 1 thrpt 5 13300505.170 ± 376839.431 ops/s +[info] ArrayOfBytesReading.simdjsonJava 10 thrpt 5 7719638.114 ± 107952.911 ops/s +[info] ArrayOfBytesReading.simdjsonJava 100 thrpt 5 1065515.528 ± 7292.624 ops/s +[info] ArrayOfBytesReading.simdjsonJava 1000 thrpt 5 119290.680 ± 5919.631 ops/s +[info] ArrayOfBytesReading.simdjsonJava 10000 thrpt 5 12094.489 ± 287.926 ops/s +[info] ArrayOfBytesReading.simdjsonJava 100000 thrpt 5 1124.157 ± 127.343 ops/s +[info] ArrayOfBytesReading.simdjsonJava 1000000 thrpt 5 115.599 ± 1.246 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 1 thrpt 5 36017257.069 ± 709225.788 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 10 thrpt 5 5216274.301 ± 114583.655 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 100 thrpt 5 535663.627 ± 2839.298 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 1000 thrpt 5 50481.310 ± 1153.250 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 10000 thrpt 5 3496.991 ± 14.464 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 100000 thrpt 5 327.582 ± 1.092 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 1000000 thrpt 5 33.424 ± 0.475 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 1 thrpt 5 8905200.513 ± 394295.626 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 10 thrpt 5 2403164.776 ± 66714.093 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 100 thrpt 5 254939.943 ± 5483.421 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 1000 thrpt 5 25386.287 ± 1691.871 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 10000 thrpt 5 2083.803 ± 34.908 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 100000 thrpt 5 244.877 ± 3.193 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 1000000 thrpt 5 24.156 ± 0.517 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 1 thrpt 5 47896470.235 ± 602913.810 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 10 thrpt 5 7527668.881 ± 48094.176 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 100 thrpt 5 726530.075 ± 18871.610 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 1000 thrpt 5 74104.500 ± 1381.868 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 10000 thrpt 5 5222.776 ± 190.984 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 100000 thrpt 5 494.902 ± 11.163 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 1000000 thrpt 5 50.077 ± 1.132 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 1 thrpt 5 10681252.145 ± 12010.509 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 10 thrpt 5 3312894.031 ± 106393.416 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 100 thrpt 5 379974.411 ± 4899.105 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 1000 thrpt 5 39288.722 ± 625.058 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 10000 thrpt 5 3083.348 ± 53.615 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 100000 thrpt 5 292.139 ± 9.961 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 1000000 thrpt 5 28.300 ± 0.558 ops/s +[info] ArrayOfIntsReading.jsoniterScala 1 thrpt 5 83742741.870 ± 1087730.279 ops/s +[info] ArrayOfIntsReading.jsoniterScala 10 thrpt 5 9369434.801 ± 41729.018 ops/s +[info] ArrayOfIntsReading.jsoniterScala 100 thrpt 5 1145042.222 ± 18680.057 ops/s +[info] ArrayOfIntsReading.jsoniterScala 1000 thrpt 5 118852.767 ± 4468.338 ops/s +[info] ArrayOfIntsReading.jsoniterScala 10000 thrpt 5 11650.739 ± 86.530 ops/s +[info] ArrayOfIntsReading.jsoniterScala 100000 thrpt 5 1115.000 ± 1.717 ops/s +[info] ArrayOfIntsReading.jsoniterScala 1000000 thrpt 5 113.991 ± 1.272 ops/s +[info] ArrayOfIntsReading.simdjsonJava 1 thrpt 5 10881349.712 ± 187309.142 ops/s +[info] ArrayOfIntsReading.simdjsonJava 10 thrpt 5 4120123.534 ± 97853.139 ops/s +[info] ArrayOfIntsReading.simdjsonJava 100 thrpt 5 718356.722 ± 32929.284 ops/s +[info] ArrayOfIntsReading.simdjsonJava 1000 thrpt 5 78773.885 ± 1453.547 ops/s +[info] ArrayOfIntsReading.simdjsonJava 10000 thrpt 5 7768.065 ± 121.619 ops/s +[info] ArrayOfIntsReading.simdjsonJava 100000 thrpt 5 758.529 ± 27.056 ops/s +[info] ArrayOfIntsReading.simdjsonJava 1000000 thrpt 5 72.726 ± 0.547 ops/s +[info] ArrayOfLongsReading.jsoniterScala 1 thrpt 5 55351029.542 ± 1880302.371 ops/s +[info] ArrayOfLongsReading.jsoniterScala 10 thrpt 5 7106828.458 ± 72710.761 ops/s +[info] ArrayOfLongsReading.jsoniterScala 100 thrpt 5 853559.047 ± 6208.558 ops/s +[info] ArrayOfLongsReading.jsoniterScala 1000 thrpt 5 75575.790 ± 951.218 ops/s +[info] ArrayOfLongsReading.jsoniterScala 10000 thrpt 5 7267.044 ± 152.408 ops/s +[info] ArrayOfLongsReading.jsoniterScala 100000 thrpt 5 778.162 ± 2.011 ops/s +[info] ArrayOfLongsReading.jsoniterScala 1000000 thrpt 5 80.142 ± 2.793 ops/s +[info] ArrayOfLongsReading.simdjsonJava 1 thrpt 5 9949708.776 ± 212728.233 ops/s +[info] ArrayOfLongsReading.simdjsonJava 10 thrpt 5 3169824.328 ± 29208.615 ops/s +[info] ArrayOfLongsReading.simdjsonJava 100 thrpt 5 508433.825 ± 19020.450 ops/s +[info] ArrayOfLongsReading.simdjsonJava 1000 thrpt 5 52009.675 ± 1340.263 ops/s +[info] ArrayOfLongsReading.simdjsonJava 10000 thrpt 5 5160.986 ± 54.266 ops/s +[info] ArrayOfLongsReading.simdjsonJava 100000 thrpt 5 497.312 ± 32.891 ops/s +[info] ArrayOfLongsReading.simdjsonJava 1000000 thrpt 5 48.882 ± 1.124 ops/s +[info] ArrayOfShortsReading.jsoniterScala 1 thrpt 5 106738175.047 ± 751944.584 ops/s +[info] ArrayOfShortsReading.jsoniterScala 10 thrpt 5 13505106.873 ± 157928.426 ops/s +[info] ArrayOfShortsReading.jsoniterScala 100 thrpt 5 1601416.835 ± 33156.305 ops/s +[info] ArrayOfShortsReading.jsoniterScala 1000 thrpt 5 168573.547 ± 640.250 ops/s +[info] ArrayOfShortsReading.jsoniterScala 10000 thrpt 5 15449.948 ± 362.875 ops/s +[info] ArrayOfShortsReading.jsoniterScala 100000 thrpt 5 1696.514 ± 17.538 ops/s +[info] ArrayOfShortsReading.jsoniterScala 1000000 thrpt 5 168.825 ± 0.869 ops/s +[info] ArrayOfShortsReading.simdjsonJava 1 thrpt 5 12765190.675 ± 220390.147 ops/s +[info] ArrayOfShortsReading.simdjsonJava 10 thrpt 5 6359268.875 ± 333157.154 ops/s +[info] ArrayOfShortsReading.simdjsonJava 100 thrpt 5 957848.585 ± 10651.241 ops/s +[info] ArrayOfShortsReading.simdjsonJava 1000 thrpt 5 107423.816 ± 1737.598 ops/s +[info] ArrayOfShortsReading.simdjsonJava 10000 thrpt 5 10604.693 ± 52.928 ops/s +[info] ArrayOfShortsReading.simdjsonJava 100000 thrpt 5 1015.194 ± 82.074 ops/s +[info] ArrayOfShortsReading.simdjsonJava 1000000 thrpt 5 100.270 ± 0.834 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 1 thrpt 5 76433599.697 ± 1647782.424 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 10 thrpt 5 56981206.751 ± 1213274.128 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 100 thrpt 5 15644695.702 ± 221627.440 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 1000 thrpt 5 2010066.814 ± 9897.757 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 10000 thrpt 5 191039.529 ± 1161.109 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 100000 thrpt 5 19569.351 ± 246.932 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 1000000 thrpt 5 1859.143 ± 38.926 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 1 thrpt 5 14280580.783 ± 178741.567 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 10 thrpt 5 13588296.235 ± 232048.550 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 100 thrpt 5 8391666.119 ± 71884.085 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 1000 thrpt 5 3260274.849 ± 62481.023 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 10000 thrpt 5 404488.330 ± 2028.164 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 100000 thrpt 5 38605.011 ± 178.014 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 1000000 thrpt 5 3043.206 ± 236.717 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 1 thrpt 5 27682343.474 ± 407726.737 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 10 thrpt 5 18283511.762 ± 1096182.905 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 100 thrpt 5 4058030.855 ± 44728.775 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 1000 thrpt 5 448540.047 ± 2216.846 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 10000 thrpt 5 40576.693 ± 102.473 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 100000 thrpt 5 4441.704 ± 9.853 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 1000000 thrpt 5 373.017 ± 4.635 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 1 thrpt 5 10274983.074 ± 174577.551 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 10 thrpt 5 4934381.705 ± 1616849.293 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 100 thrpt 5 903643.219 ± 2345.354 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 1000 thrpt 5 96370.085 ± 1995.299 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 10000 thrpt 5 9297.590 ± 109.928 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 100000 thrpt 5 908.068 ± 35.109 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 1000000 thrpt 5 89.522 ± 1.184 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 1 thrpt 5 32786706.810 ± 788621.141 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 10 thrpt 5 19624073.733 ± 723638.922 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 100 thrpt 5 3936585.889 ± 48338.443 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 1000 thrpt 5 426123.837 ± 2263.884 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 10000 thrpt 5 36359.743 ± 210.491 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 100000 thrpt 5 3835.072 ± 10.330 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 1000000 thrpt 5 377.968 ± 7.973 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 1 thrpt 5 10715510.964 ± 101357.233 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 10 thrpt 5 8768707.591 ± 86756.250 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 100 thrpt 5 2574772.821 ± 47094.263 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 1000 thrpt 5 346046.650 ± 1343.571 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 10000 thrpt 5 29272.228 ± 57.714 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 100000 thrpt 5 2787.651 ± 2.429 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 1000000 thrpt 5 281.176 ± 8.118 ops/s diff --git a/jsoniter-scala-vs-simdjson-java.txt b/jsoniter-scala-vs-simdjson-java.txt new file mode 100644 index 000000000..6069c6182 --- /dev/null +++ b/jsoniter-scala-vs-simdjson-java.txt @@ -0,0 +1,141 @@ +[info] Benchmark (size) Mode Cnt Score Error Units +[info] ArrayOfBooleansReading.jsoniterScala 1 thrpt 5 342503559.459 ± 94837291.450 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 10 thrpt 5 48939435.924 ± 4245185.366 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 100 thrpt 5 12167436.026 ± 336093.863 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 1000 thrpt 5 1184541.389 ± 14461.530 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 10000 thrpt 5 118741.757 ± 1519.617 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 100000 thrpt 5 11923.401 ± 691.732 ops/s +[info] ArrayOfBooleansReading.jsoniterScala 1000000 thrpt 5 1113.054 ± 25.653 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 1 thrpt 5 17184801.334 ± 1538621.712 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 10 thrpt 5 12621848.925 ± 1566111.483 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 100 thrpt 5 3269345.594 ± 130318.700 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 1000 thrpt 5 476790.853 ± 14781.822 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 10000 thrpt 5 57267.472 ± 869.031 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 100000 thrpt 5 4415.576 ± 349.578 ops/s +[info] ArrayOfBooleansReading.simdjsonJava 1000000 thrpt 5 458.641 ± 24.478 ops/s +[info] ArrayOfBytesReading.jsoniterScala 1 thrpt 5 268561020.550 ± 77324371.155 ops/s +[info] ArrayOfBytesReading.jsoniterScala 10 thrpt 5 46593849.730 ± 6109628.195 ops/s +[info] ArrayOfBytesReading.jsoniterScala 100 thrpt 5 7550390.015 ± 144502.376 ops/s +[info] ArrayOfBytesReading.jsoniterScala 1000 thrpt 5 658668.631 ± 22044.081 ops/s +[info] ArrayOfBytesReading.jsoniterScala 10000 thrpt 5 66166.132 ± 528.676 ops/s +[info] ArrayOfBytesReading.jsoniterScala 100000 thrpt 5 6629.273 ± 259.597 ops/s +[info] ArrayOfBytesReading.jsoniterScala 1000000 thrpt 5 655.106 ± 8.175 ops/s +[info] ArrayOfBytesReading.simdjsonJava 1 thrpt 5 15112501.286 ± 1539759.720 ops/s +[info] ArrayOfBytesReading.simdjsonJava 10 thrpt 5 11428094.210 ± 1097748.306 ops/s +[info] ArrayOfBytesReading.simdjsonJava 100 thrpt 5 2568849.567 ± 133494.381 ops/s +[info] ArrayOfBytesReading.simdjsonJava 1000 thrpt 5 317017.012 ± 6846.109 ops/s +[info] ArrayOfBytesReading.simdjsonJava 10000 thrpt 5 38094.570 ± 2993.566 ops/s +[info] ArrayOfBytesReading.simdjsonJava 100000 thrpt 5 3328.724 ± 467.470 ops/s +[info] ArrayOfBytesReading.simdjsonJava 1000000 thrpt 5 353.045 ± 4.026 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 1 thrpt 5 103176104.083 ± 7854376.019 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 10 thrpt 5 16814014.335 ± 349064.666 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 100 thrpt 5 1688288.400 ± 36975.313 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 1000 thrpt 5 177231.168 ± 1458.384 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 10000 thrpt 5 12277.006 ± 140.960 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 100000 thrpt 5 1174.766 ± 41.234 ops/s +[info] ArrayOfDoublesReading.jsoniterScala 1000000 thrpt 5 111.642 ± 2.586 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 1 thrpt 5 15909638.737 ± 1918741.117 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 10 thrpt 5 5915891.366 ± 277654.137 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 100 thrpt 5 827054.245 ± 61740.937 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 1000 thrpt 5 92376.973 ± 2056.557 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 10000 thrpt 5 8288.742 ± 78.794 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 100000 thrpt 5 898.629 ± 40.698 ops/s +[info] ArrayOfDoublesReading.simdjsonJava 1000000 thrpt 5 84.125 ± 5.711 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 1 thrpt 5 89407283.850 ± 10014078.477 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 10 thrpt 5 22657790.822 ± 710248.623 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 100 thrpt 5 2346038.889 ± 15089.976 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 1000 thrpt 5 236023.305 ± 1326.557 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 10000 thrpt 5 17682.249 ± 390.782 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 100000 thrpt 5 1845.703 ± 23.927 ops/s +[info] ArrayOfFloatsReading.jsoniterScala 1000000 thrpt 5 175.236 ± 1.368 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 1 thrpt 5 12827287.855 ± 868112.702 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 10 thrpt 5 6895766.515 ± 64426.633 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 100 thrpt 5 1187928.851 ± 192113.324 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 1000 thrpt 5 154859.172 ± 2010.135 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 10000 thrpt 5 11297.805 ± 381.947 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 100000 thrpt 5 1168.153 ± 68.220 ops/s +[info] ArrayOfFloatsReading.simdjsonJava 1000000 thrpt 5 97.368 ± 4.294 ops/s +[info] ArrayOfIntsReading.jsoniterScala 1 thrpt 5 171422893.496 ± 25581676.840 ops/s +[info] ArrayOfIntsReading.jsoniterScala 10 thrpt 5 31949224.643 ± 952937.776 ops/s +[info] ArrayOfIntsReading.jsoniterScala 100 thrpt 5 4048513.374 ± 74899.871 ops/s +[info] ArrayOfIntsReading.jsoniterScala 1000 thrpt 5 443794.915 ± 3735.835 ops/s +[info] ArrayOfIntsReading.jsoniterScala 10000 thrpt 5 41359.385 ± 157.138 ops/s +[info] ArrayOfIntsReading.jsoniterScala 100000 thrpt 5 4129.110 ± 24.227 ops/s +[info] ArrayOfIntsReading.jsoniterScala 1000000 thrpt 5 412.145 ± 9.157 ops/s +[info] ArrayOfIntsReading.simdjsonJava 1 thrpt 5 15029304.911 ± 1508905.162 ops/s +[info] ArrayOfIntsReading.simdjsonJava 10 thrpt 5 8674252.356 ± 443961.516 ops/s +[info] ArrayOfIntsReading.simdjsonJava 100 thrpt 5 2031218.253 ± 61362.259 ops/s +[info] ArrayOfIntsReading.simdjsonJava 1000 thrpt 5 174946.389 ± 16883.590 ops/s +[info] ArrayOfIntsReading.simdjsonJava 10000 thrpt 5 25816.229 ± 2364.572 ops/s +[info] ArrayOfIntsReading.simdjsonJava 100000 thrpt 5 2542.692 ± 33.826 ops/s +[info] ArrayOfIntsReading.simdjsonJava 1000000 thrpt 5 242.605 ± 4.551 ops/s +[info] ArrayOfLongsReading.jsoniterScala 1 thrpt 5 144479477.357 ± 16423150.249 ops/s +[info] ArrayOfLongsReading.jsoniterScala 10 thrpt 5 21541976.406 ± 672293.491 ops/s +[info] ArrayOfLongsReading.jsoniterScala 100 thrpt 5 2743713.399 ± 17263.628 ops/s +[info] ArrayOfLongsReading.jsoniterScala 1000 thrpt 5 263585.725 ± 1538.501 ops/s +[info] ArrayOfLongsReading.jsoniterScala 10000 thrpt 5 25588.520 ± 213.412 ops/s +[info] ArrayOfLongsReading.jsoniterScala 100000 thrpt 5 2683.125 ± 34.888 ops/s +[info] ArrayOfLongsReading.jsoniterScala 1000000 thrpt 5 268.322 ± 9.987 ops/s +[info] ArrayOfLongsReading.simdjsonJava 1 thrpt 5 15239255.282 ± 811517.762 ops/s +[info] ArrayOfLongsReading.simdjsonJava 10 thrpt 5 7658433.565 ± 120594.898 ops/s +[info] ArrayOfLongsReading.simdjsonJava 100 thrpt 5 1648975.617 ± 16928.725 ops/s +[info] ArrayOfLongsReading.simdjsonJava 1000 thrpt 5 163499.487 ± 2337.098 ops/s +[info] ArrayOfLongsReading.simdjsonJava 10000 thrpt 5 15402.254 ± 775.501 ops/s +[info] ArrayOfLongsReading.simdjsonJava 100000 thrpt 5 1534.614 ± 35.577 ops/s +[info] ArrayOfLongsReading.simdjsonJava 1000000 thrpt 5 148.629 ± 9.382 ops/s +[info] ArrayOfShortsReading.jsoniterScala 1 thrpt 5 215519205.688 ± 23964442.573 ops/s +[info] ArrayOfShortsReading.jsoniterScala 10 thrpt 5 36065770.492 ± 5200236.437 ops/s +[info] ArrayOfShortsReading.jsoniterScala 100 thrpt 5 6044396.887 ± 109805.282 ops/s +[info] ArrayOfShortsReading.jsoniterScala 1000 thrpt 5 635417.617 ± 13740.227 ops/s +[info] ArrayOfShortsReading.jsoniterScala 10000 thrpt 5 56392.046 ± 729.926 ops/s +[info] ArrayOfShortsReading.jsoniterScala 100000 thrpt 5 5899.067 ± 49.563 ops/s +[info] ArrayOfShortsReading.jsoniterScala 1000000 thrpt 5 584.148 ± 12.269 ops/s +[info] ArrayOfShortsReading.simdjsonJava 1 thrpt 5 13141892.316 ± 1085242.262 ops/s +[info] ArrayOfShortsReading.simdjsonJava 10 thrpt 5 11753834.940 ± 473225.950 ops/s +[info] ArrayOfShortsReading.simdjsonJava 100 thrpt 5 2345736.800 ± 79721.325 ops/s +[info] ArrayOfShortsReading.simdjsonJava 1000 thrpt 5 281859.137 ± 11547.589 ops/s +[info] ArrayOfShortsReading.simdjsonJava 10000 thrpt 5 34854.771 ± 842.362 ops/s +[info] ArrayOfShortsReading.simdjsonJava 100000 thrpt 5 3297.706 ± 56.319 ops/s +[info] ArrayOfShortsReading.simdjsonJava 1000000 thrpt 5 293.921 ± 28.258 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 1 thrpt 5 137819676.734 ± 7539915.697 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 10 thrpt 5 118894217.591 ± 13310219.889 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 100 thrpt 5 37753567.345 ± 4406155.730 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 1000 thrpt 5 6972392.422 ± 124197.699 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 10000 thrpt 5 707366.526 ± 9600.511 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 100000 thrpt 5 68127.234 ± 405.583 ops/s +[info] StringOfAsciiCharsReading.jsoniterScala 1000000 thrpt 5 5418.742 ± 95.045 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 1 thrpt 5 17626576.781 ± 1181870.268 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 10 thrpt 5 17122186.260 ± 1104741.009 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 100 thrpt 5 11650135.392 ± 433651.425 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 1000 thrpt 5 7681333.464 ± 129218.381 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 10000 thrpt 5 1216693.708 ± 11857.377 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 100000 thrpt 5 115667.183 ± 1624.789 ops/s +[info] StringOfAsciiCharsReading.simdjsonJava 1000000 thrpt 5 4674.727 ± 128.224 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 1 thrpt 5 54151027.601 ± 3612893.888 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 10 thrpt 5 43963414.167 ± 6293021.032 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 100 thrpt 5 14383019.775 ± 459401.800 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 1000 thrpt 5 1876768.744 ± 8610.632 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 10000 thrpt 5 187388.199 ± 1213.853 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 100000 thrpt 5 12293.167 ± 253.232 ops/s +[info] StringOfEscapedCharsReading.jsoniterScala 1000000 thrpt 5 1274.419 ± 24.221 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 1 thrpt 5 14635930.164 ± 1256179.146 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 10 thrpt 5 10197004.867 ± 525852.900 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 100 thrpt 5 3213374.528 ± 59052.191 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 1000 thrpt 5 429637.777 ± 5831.158 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 10000 thrpt 5 39842.125 ± 570.067 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 100000 thrpt 5 3629.545 ± 52.262 ops/s +[info] StringOfEscapedCharsReading.simdjsonJava 1000000 thrpt 5 350.726 ± 12.351 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 1 thrpt 5 84164087.133 ± 7016611.721 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 10 thrpt 5 48338106.294 ± 10139117.906 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 100 thrpt 5 14448098.215 ± 345847.954 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 1000 thrpt 5 1710692.767 ± 17140.754 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 10000 thrpt 5 138915.272 ± 419.348 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 100000 thrpt 5 12247.844 ± 71.509 ops/s +[info] StringOfNonAsciiCharsReading.jsoniterScala 1000000 thrpt 5 1297.644 ± 16.323 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 1 thrpt 5 15023285.313 ± 1226989.493 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 10 thrpt 5 13685086.005 ± 541323.685 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 100 thrpt 5 6227403.642 ± 99852.384 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 1000 thrpt 5 1110856.445 ± 7680.271 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 10000 thrpt 5 102040.640 ± 954.302 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 100000 thrpt 5 8661.948 ± 98.715 ops/s +[info] StringOfNonAsciiCharsReading.simdjsonJava 1000000 thrpt 5 747.699 ± 10.359 ops/s