File tree 1 file changed +20
-0
lines changed
commons-benchmark/jvm/src/main/scala/com/avsystem/commons/ser
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,18 @@ class JsonDecodingBenchmark extends JsonSerializationBenchmark {
67
67
68
68
class JsonWritingBenchmark extends JsonSerializationBenchmark {
69
69
70
+ @ Benchmark
71
+ def writePrimitivesCirce : String =
72
+ Primitives .Example .asJson.noSpaces
73
+
70
74
@ Benchmark
71
75
def writePrimitivesGenCodec : String =
72
76
JsonStringOutput .write(Primitives .Example )
73
77
78
+ @ Benchmark
79
+ def writePrimitivesUpickle : String =
80
+ upickle.default.write(Primitives .Example )
81
+
74
82
@ Benchmark
75
83
def writeCCCirce : String =
76
84
Something .Example .asJson.noSpaces
@@ -113,6 +121,18 @@ class JsonWritingBenchmark extends JsonSerializationBenchmark {
113
121
}
114
122
115
123
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
+
116
136
@ Benchmark
117
137
def readCCCirce : Something =
118
138
decode[Something ](Something .ExampleJsonString ).fold(e => throw e, identity)
You can’t perform that action at this time.
0 commit comments