@@ -246,19 +246,19 @@ Each test processes 190 bytes of http log as a JSON record.
246
246
It should read multiple fields.
247
247
https://github.com/buger/jsonparser/blob/master/benchmark/benchmark_small_payload_test.go
248
248
249
- | Library | time/op | bytes/op | allocs/op |
250
- | --- | --- | --- | --- | --- |
251
- | encoding/json struct | 7879 | 880 | 18 |
252
- | encoding/json interface{} | 8946 | 1521 | 38|
253
- | Jeffail/gabs | 10053 | 1649 | 46 |
254
- | bitly/go-simplejson | 10128 | 2241 | 36 |
255
- | antonholmquist/jason | 27152 | 7237 | 101 |
256
- | github.com/ugorji/go/codec | 8806 | 2176 | 31 |
257
- | mreiferson/go-ujson | ** 7008** | ** 1409** | 37 |
258
- | pquerna/ffjson | ** 3769** | ** 624** | ** 15** |
259
- | mailru/easyjson | ** 2002** | ** 192** | ** 9** |
260
- | buger/jsonparser | ** 1367** | ** 0** | ** 0** |
261
- | buger/jsonparser (EachKey API) | ** 809** | ** 0** | ** 0** |
249
+ Library | time/op | bytes/op | allocs/op
250
+ ------ | ------- | -------- | -------
251
+ encoding/json struct | 7879 | 880 | 18
252
+ encoding/json interface{} | 8946 | 1521 | 38
253
+ Jeffail/gabs | 10053 | 1649 | 46
254
+ bitly/go-simplejson | 10128 | 2241 | 36
255
+ antonholmquist/jason | 27152 | 7237 | 101
256
+ github.com/ugorji/go/codec | 8806 | 2176 | 31
257
+ mreiferson/go-ujson | ** 7008** | ** 1409** | 37
258
+ pquerna/ffjson | ** 3769** | ** 624** | ** 15**
259
+ mailru/easyjson | ** 2002** | ** 192** | ** 9**
260
+ buger/jsonparser | ** 1367** | ** 0** | ** 0**
261
+ buger/jsonparser (EachKey API) | ** 809** | ** 0** | ** 0**
262
262
263
263
Winners are ffjson, easyjson and jsonparser, where jsonparser is up to 9.8x faster than encoding/json and 4.6x faster than ffjson, and slightly faster than easyjson.
264
264
If you look at memory allocation, jsonparser has no rivals, as it makes no data copy and operates with raw [ ] byte structures and pointers to it.
@@ -271,7 +271,7 @@ It should read multiple nested fields and 1 array.
271
271
https://github.com/buger/jsonparser/blob/master/benchmark/benchmark_medium_payload_test.go
272
272
273
273
| Library | time/op | bytes/op | allocs/op |
274
- | --- | --- | --- | --- | --- |
274
+ | ------- | ------- | -------- | ------ --- |
275
275
| encoding/json struct | 57749 | 1336 | 29 |
276
276
| encoding/json interface{} | 79297 | 10627 | 215 |
277
277
| Jeffail/gabs | 83807 | 11202 | 235 |
@@ -299,7 +299,7 @@ Basically it means processing a full JSON file.
299
299
https://github.com/buger/jsonparser/blob/master/benchmark/benchmark_large_payload_test.go
300
300
301
301
| Library | time/op | bytes/op | allocs/op |
302
- | --- | --- | --- | --- | --- |
302
+ | --- | --- | --- | --- |
303
303
| encoding/json struct | 748336 | 8272 | 307 |
304
304
| encoding/json interface{} | 1224271 | 215425 | 3395 |
305
305
| pquerna/ffjson | ** 312271** | ** 7792** | ** 298** |
0 commit comments