Skip to content

Commit

Permalink
Update zio-json to 0.7.6 and zio-schema-json to 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Jan 24, 2025
1 parent ad91a27 commit af168b8
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 29 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ lazy val `jsoniter-scala-benchmark` = crossProject(JVMPlatform, JSPlatform)
"com.disneystreaming.smithy4s" %%% "smithy4s-json" % "0.18.29",
"com.evolutiongaming" %%% "play-json-jsoniter" % "0.10.3" intransitive(),
"org.playframework" %%% "play-json" % "3.0.4",
"dev.zio" %%% "zio-json" % "0.7.4",
"dev.zio" %%% "zio-schema-json" % "1.5.0",
"dev.zio" %%% "zio-json" % "0.7.6",
"dev.zio" %%% "zio-schema-json" % "1.6.1",
"io.circe" %%% "circe-generic" % "0.14.10",
"io.circe" %%% "circe-jawn" % "0.14.10",
"com.lihaoyi" %%% "upickle" % "4.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1420,9 +1420,8 @@ object Main {
B("playJsonJsoniter")(benchmark.playJsonJsoniter()),
B("smithy4sJson")(benchmark.smithy4sJson()),
B("uPickle")(benchmark.uPickle()),
B("zioJson")(benchmark.zioJson())
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//B("zioSchemaJson")(benchmark.zioSchemaJson())
B("zioJson")(benchmark.zioJson()),
B("zioSchemaJson")(benchmark.zioSchemaJson())
))
}, {
val benchmark = new NestedStructsWriting { size = 128; setup() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1319,9 +1319,8 @@ object Main {
B("playJsonJsoniter")(benchmark.playJsonJsoniter()),
B("smithy4sJson")(benchmark.smithy4sJson()),
B("uPickle")(benchmark.uPickle()),
B("zioJson")(benchmark.zioJson())
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//B("zioSchemaJson")(benchmark.zioSchemaJson())
B("zioJson")(benchmark.zioJson()),
B("zioSchemaJson")(benchmark.zioSchemaJson())
))
}, {
val benchmark = new NestedStructsWriting { size = 128; setup() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
benchmark.smithy4sJson() shouldBe benchmark.obj
benchmark.uPickle() shouldBe benchmark.obj
benchmark.zioJson() shouldBe benchmark.obj
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//benchmark.zioSchemaJson() shouldBe benchmark.obj
benchmark.zioSchemaJson() shouldBe benchmark.obj
}
"fail on invalid input" in {
val b = benchmark
Expand All @@ -35,8 +34,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
intercept[Throwable](b.smithy4sJson())
intercept[Throwable](b.uPickle())
intercept[Throwable](b.zioJson())
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//intercept[Throwable](b.zioJson())
intercept[Throwable](b.zioSchemaJson())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
benchmark.smithy4sJson() shouldBe benchmark.obj
benchmark.uPickle() shouldBe benchmark.obj
benchmark.zioJson() shouldBe benchmark.obj
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//benchmark.zioSchemaJson() shouldBe benchmark.obj
benchmark.zioSchemaJson() shouldBe benchmark.obj
}
"fail on invalid input" in {
val b = benchmark
Expand All @@ -33,8 +32,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
intercept[Throwable](b.smithy4sJson())
intercept[Throwable](b.uPickle())
intercept[Throwable](b.zioJson())
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//intercept[Throwable](b.zioSchemaJson())
intercept[Throwable](b.zioSchemaJson())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
benchmark.uPickle() shouldBe benchmark.obj
benchmark.weePickle() shouldBe benchmark.obj
benchmark.zioJson() shouldBe benchmark.obj
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//benchmark.zioSchemaJson() shouldBe benchmark.obj
benchmark.zioSchemaJson() shouldBe benchmark.obj
}
"fail on invalid input" in {
val b = benchmark
Expand All @@ -48,8 +47,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
intercept[Throwable](b.uPickle())
intercept[Throwable](b.weePickle())
intercept[Throwable](b.zioJson())
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//intercept[Throwable](b.zioSchemaJson())
intercept[Throwable](b.zioSchemaJson())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
benchmark.uPickle() shouldBe benchmark.obj
benchmark.weePickle() shouldBe benchmark.obj
benchmark.zioJson() shouldBe benchmark.obj
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//benchmark.zioSchemaJson() shouldBe benchmark.obj
benchmark.zioSchemaJson() shouldBe benchmark.obj
}
"fail on invalid input" in {
val b = benchmark
Expand All @@ -44,8 +43,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
intercept[Throwable](b.uPickle())
intercept[Throwable](b.weePickle())
intercept[Throwable](b.zioJson())
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
//intercept[Throwable](b.zioSchemaJson())
intercept[Throwable](b.zioSchemaJson())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,12 @@ class NestedStructsReading extends NestedStructsBenchmark {

new String(jsonBytes, UTF_8).fromJson[NestedStructs].fold(sys.error, identity)
}
/* FIXME: zio-schema-json parses only 127 levels of nesting instead of 128

@Benchmark
def zioSchemaJson(): NestedStructs = {
import com.github.plokhotnyuk.jsoniter_scala.benchmark.ZioSchemaJsonCodecs._
import java.nio.charset.StandardCharsets.UTF_8

nestedStructsCodec.decodeJson(new String(jsonBytes, UTF_8)).fold(sys.error, identity)
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,12 @@ class NestedStructsReading extends NestedStructsBenchmark {

new String(jsonBytes, UTF_8).fromJson[NestedStructs].fold(sys.error, identity)
}
/* FIXME: zio-schema-json parses only 127 levels of nesting instead of 128

@Benchmark
def zioSchemaJson(): NestedStructs = {
import com.github.plokhotnyuk.jsoniter_scala.benchmark.ZioSchemaJsonCodecs._
import java.nio.charset.StandardCharsets.UTF_8

nestedStructsCodec.decodeJson(new String(jsonBytes, UTF_8)).fold(sys.error, identity)
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import scala.collection.immutable.ArraySeq
import scala.reflect.ClassTag

object ZioJsonCodecs {
implicit val config: JsonCodecConfiguration = JsonCodecConfiguration(explicitEmptyCollections = false)
implicit val adtC3c: JsonCodec[ADTBase] = DeriveJsonCodec.gen
implicit val geoJsonC3c: JsonCodec[GeoJSON.GeoJSON] = {
implicit val c1: JsonCodec[GeoJSON.SimpleGeometry] = DeriveJsonCodec.gen
Expand Down

0 comments on commit af168b8

Please sign in to comment.