@@ -20,6 +20,7 @@ import (
20
20
"github.com/gogo/protobuf/proto"
21
21
flatbuffers "github.com/google/flatbuffers/go"
22
22
"github.com/hprose/hprose-go"
23
+ jsoniter "github.com/json-iterator/go"
23
24
"github.com/ikkerens/ikeapack"
24
25
"github.com/tinylib/msgp/msgp"
25
26
"github.com/ugorji/go/codec"
@@ -209,6 +210,31 @@ func BenchmarkJsonUnmarshal(b *testing.B) {
209
210
benchUnmarshal (b , JsonSerializer {})
210
211
}
211
212
213
+ // github.com/json-iterator/go
214
+
215
+ type JsonIterSerializer struct {}
216
+
217
+ func (j JsonIterSerializer ) Marshal (o interface {}) []byte {
218
+ d , _ := jsoniter .Marshal (o )
219
+ return d
220
+ }
221
+
222
+ func (j JsonIterSerializer ) Unmarshal (d []byte , o interface {}) error {
223
+ return jsoniter .Unmarshal (d , o )
224
+ }
225
+
226
+ func (j JsonIterSerializer ) String () string {
227
+ return "jsoniter"
228
+ }
229
+
230
+ func BenchmarkJsonIterMarshal (b * testing.B ) {
231
+ benchMarshal (b , JsonIterSerializer {})
232
+ }
233
+
234
+ func BenchmarkJsonIterUnmarshal (b * testing.B ) {
235
+ benchUnmarshal (b , JsonIterSerializer {})
236
+ }
237
+
212
238
// github.com/mailru/easyjson
213
239
214
240
type EasyJSONSerializer struct {}
0 commit comments