Skip to content

Commit cd0db29

Browse files
committed
Clean up of benchmarks
1 parent 72ccaaa commit cd0db29

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ object DslPlatformJson {
3434

3535
val (stringEncoder: JsonWriter.WriteObject[String],
3636
stringDecoder: JsonReader.ReadObject[String]) = codec[String]
37-
implicit val (arrayBufferOfBooleansEncoder: JsonWriter.WriteObject[mutable.ArrayBuffer[Boolean]],
38-
arrayBufferOfBooleansDecoder: JsonReader.ReadObject[mutable.ArrayBuffer[Boolean]]) = codec[mutable.ArrayBuffer[Boolean]]
3937
implicit val (arrayOfBigDecimalsEncoder: JsonWriter.WriteObject[Array[BigDecimal]],
4038
arrayOfBigDecimalsDecoder: JsonReader.ReadObject[Array[BigDecimal]]) = codec[Array[BigDecimal]]
4139
implicit val (arrayOfBigIntsEncoder: JsonWriter.WriteObject[Array[BigInt]],
@@ -83,18 +81,19 @@ object DslPlatformJson {
8381
implicit val (googleMapsAPIEncoder: JsonWriter.WriteObject[GoogleMapsAPI.DistanceMatrix],
8482
googleMapsAPIDecoder: JsonReader.ReadObject[GoogleMapsAPI.DistanceMatrix]) = codec[GoogleMapsAPI.DistanceMatrix]
8583
implicit val (intEncoder: JsonWriter.WriteObject[Int], intDecoder: JsonReader.ReadObject[Int]) = codec[Int]
86-
/* FIXME: DSL-JSON doesn't support immutable.IntMap
84+
/* FIXME: DSL-JSON doesn't support immutable.IntMap
8785
implicit val (intMapOfBooleansEncoder: JsonWriter.WriteObject[IntMap[Boolean]],
88-
intMapOfBooleansDecoder: JsonReader.ReadObject[IntMap[Boolean]]) = codec[IntMap[Boolean]]
86+
intMapOfBooleansDecoder: JsonReader.ReadObject[IntMap[Boolean]]) = codec[IntMap[Boolean]]
8987
*/
9088
implicit val (listOfBooleansEncoder: JsonWriter.WriteObject[List[Boolean]],
9189
listOfBooleansDecoder: JsonReader.ReadObject[List[Boolean]]) = codec[List[Boolean]]
9290
implicit val (mapOfIntsToBooleansEncoder: JsonWriter.WriteObject[Map[Int, Boolean]],
9391
mapOfIntsToBooleansDecoder: JsonReader.ReadObject[Map[Int, Boolean]]) = codec[Map[Int, Boolean]]
9492
implicit val (mutableBitSetEncoder: JsonWriter.WriteObject[mutable.BitSet],
9593
mutableBitSetDecoder: JsonReader.ReadObject[mutable.BitSet]) = codec[mutable.BitSet]
96-
/* FIXME: DSL-JSON doesn't support mutable.LongMap
97-
implicit val (mutableLongMapOfBooleansEncoder: JsonWriter.WriteObject[mutable.LongMap[Boolean]], mutableLongMapOfBooleansDecoder: JsonReader.ReadObject[mutable.LongMap[Boolean]]) = codec[mutable.LongMap[Boolean]]
94+
/* FIXME: DSL-JSON doesn't support mutable.LongMap
95+
implicit val (mutableLongMapOfBooleansEncoder: JsonWriter.WriteObject[mutable.LongMap[Boolean]],
96+
mutableLongMapOfBooleansDecoder: JsonReader.ReadObject[mutable.LongMap[Boolean]]) = codec[mutable.LongMap[Boolean]]
9897
*/
9998
implicit val (mutableMapOfIntsToBooleansEncoder: JsonWriter.WriteObject[mutable.Map[Int, Boolean]],
10099
mutableMapOfIntsToBooleansDecoder: JsonReader.ReadObject[mutable.Map[Int, Boolean]]) = codec[mutable.Map[Int, Boolean]]

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,24 +1196,6 @@ object SprayFormats extends DefaultJsonProtocol {
11961196
def write(obj: T): JsValue = new JsString(obj.toString)
11971197
}
11981198

1199-
implicit def arrayBufferJsonFormat[T : JsonFormat]: RootJsonFormat[mutable.ArrayBuffer[T]] =
1200-
new RootJsonFormat[mutable.ArrayBuffer[T]] {
1201-
def read(json: JsValue): mutable.ArrayBuffer[T] =
1202-
if (!json.isInstanceOf[JsArray]) deserializationError(s"Expected JSON array")
1203-
else {
1204-
val es = json.asInstanceOf[JsArray].elements
1205-
val buf = new mutable.ArrayBuffer[T](es.size)
1206-
es.foreach(e => buf.addOne(e.convertTo[T]))
1207-
buf
1208-
}
1209-
1210-
def write(buf: mutable.ArrayBuffer[T]): JsValue = {
1211-
val vs = Vector.newBuilder[JsValue]
1212-
buf.foreach(x => vs.addOne(x.toJson))
1213-
new JsArray(vs.result())
1214-
}
1215-
}
1216-
12171199
implicit def arraySeqJsonFormat[T : JsonFormat : ClassTag]: RootJsonFormat[ArraySeq[T]] =
12181200
new RootJsonFormat[ArraySeq[T]] {
12191201
def read(json: JsValue): ArraySeq[T] = json match {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ object ZioSchemaJsonCodecs {
1818
implicit def array[A: ClassTag](implicit schemaA: Schema[A]): Schema[Array[A]] =
1919
Schema.Sequence[Array[A], A, String](schemaA, _.toArray, Chunk.fromArray, Chunk.empty, "Array")
2020

21-
implicit def arrayBuffer[A](implicit schemaA: Schema[A]): Schema[mutable.ArrayBuffer[A]] =
22-
Schema.Sequence(schemaA, mutable.ArrayBuffer.from, Chunk.fromIterable, Chunk.empty, "ArrayBuffer")
23-
2421
implicit def arraySeq[A: ClassTag](implicit schemaA: Schema[A]): Schema[ArraySeq[A]] =
2522
Schema.Sequence[ArraySeq[A], A, String](schemaA, x => ArraySeq.unsafeWrapArray(x.toArray),
2623
x => Chunk.fromArray[A](x.unsafeArray.asInstanceOf[Array[A]]), Chunk.empty, "ArraySeq")

0 commit comments

Comments
 (0)