Skip to content

Commit fed6f31

Browse files
committed
benchmarks updated
1 parent e12112c commit fed6f31

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: commons-benchmark/jvm/src/main/scala/com/avsystem/commons/ser/JsonSerializationBenchmark.scala

+20
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,18 @@ class JsonDecodingBenchmark extends JsonSerializationBenchmark {
6767

6868
class JsonWritingBenchmark extends JsonSerializationBenchmark {
6969

70+
@Benchmark
71+
def writePrimitivesCirce: String =
72+
Primitives.Example.asJson.noSpaces
73+
7074
@Benchmark
7175
def writePrimitivesGenCodec: String =
7276
JsonStringOutput.write(Primitives.Example)
7377

78+
@Benchmark
79+
def writePrimitivesUpickle: String =
80+
upickle.default.write(Primitives.Example)
81+
7482
@Benchmark
7583
def writeCCCirce: String =
7684
Something.Example.asJson.noSpaces
@@ -113,6 +121,18 @@ class JsonWritingBenchmark extends JsonSerializationBenchmark {
113121
}
114122

115123
class JsonReadingBenchmark extends JsonSerializationBenchmark {
124+
@Benchmark
125+
def readPrimitivesCirce: Primitives =
126+
decode[Primitives](Primitives.ExampleJsonString).fold(e => throw e, identity)
127+
128+
@Benchmark
129+
def readPrimitivesGenCodec: Primitives =
130+
JsonStringInput.read[Primitives](Primitives.ExampleJsonString)
131+
132+
@Benchmark
133+
def readPrimitivesUpickle: Primitives =
134+
upickle.default.read[Primitives](Primitives.ExampleJsonString)
135+
116136
@Benchmark
117137
def readCCCirce: Something =
118138
decode[Something](Something.ExampleJsonString).fold(e => throw e, identity)

0 commit comments

Comments
 (0)