Skip to content

Commit 869efc2

Browse files
committed
Clean up of benchmarks
1 parent 4cda251 commit 869efc2

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

jsoniter-scala-benchmark/js/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/ADTWritingSpec.scala

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ADTWritingSpec extends BenchmarkSpecBase {
1818
toString(b.playJsonJsoniter()) shouldBe b.jsonString1
1919
toString(b.smithy4sJson()) shouldBe b.jsonString1
2020
toString(b.uPickle()) shouldBe b.jsonString1
21+
toString(b.zioJson()) shouldBe b.jsonString1
2122
//FIXME: zio-schema-json doesn't serialize the discriminator field
2223
//toString(b.zioJson()) shouldBe b.jsonString1
2324
}

jsoniter-scala-benchmark/js/src/test/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/NestedStructsReadingSpec.scala

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class NestedStructsReadingSpec extends BenchmarkSpecBase {
3434
intercept[Throwable](b.playJsonJsoniter())
3535
intercept[Throwable](b.smithy4sJson())
3636
intercept[Throwable](b.uPickle())
37+
intercept[Throwable](b.zioJson())
3738
//FIXME: zio-schema-json parses only 127 levels of nesting instead of 128
3839
//intercept[Throwable](b.zioJson())
3940
}

jsoniter-scala-benchmark/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/ADTWriting.scala

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ class ADTWriting extends ADTBenchmark {
133133
def zioJson(): Array[Byte] = {
134134
import com.github.plokhotnyuk.jsoniter_scala.benchmark.ZioJsonCodecs._
135135
import zio.json.EncoderOps
136-
import zio.json.JsonEncoder._
137136
import java.nio.charset.StandardCharsets.UTF_8
138137

139138
obj.toJson.getBytes(UTF_8)

jsoniter-scala-benchmark/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/benchmark/ArrayOfEnumsReading.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ class ArrayOfEnumsReading extends ArrayOfEnumsBenchmark {
114114

115115
@Benchmark
116116
def zioJson(): Array[SuitEnum] = {
117+
import com.github.plokhotnyuk.jsoniter_scala.benchmark.ZioJsonCodecs._
117118
import zio.json.DecoderOps
118119
import java.nio.charset.StandardCharsets.UTF_8
119120

120-
new String(jsonBytes, UTF_8).fromJson[Array[SuitEnum]](ZioJsonCodecs.arrayOfEnumsC3c.decoder).fold(sys.error, identity)
121+
new String(jsonBytes, UTF_8).fromJson[Array[SuitEnum]].fold(sys.error, identity)
121122
}
122123
}

0 commit comments

Comments
 (0)