1
1
[ ![ Sourcegraph] ( https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg )] ( https://sourcegraph.com/github.com/json-iterator/go?badge )
2
- [ ![ GoDoc] ( http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square )] ( http ://godoc.org /github.com/json-iterator/go)
2
+ [ ![ GoDoc] ( http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square )] ( https ://pkg.go.dev /github.com/json-iterator/go)
3
3
[ ![ Build Status] ( https://travis-ci.org/json-iterator/go.svg?branch=master )] ( https://travis-ci.org/json-iterator/go )
4
4
[ ![ codecov] ( https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg )] ( https://codecov.io/gh/json-iterator/go )
5
5
[ ![ rcard] ( https://goreportcard.com/badge/github.com/json-iterator/go )] ( https://goreportcard.com/report/github.com/json-iterator/go )
@@ -18,16 +18,16 @@ Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/githu
18
18
19
19
Raw Result (easyjson requires static code generation)
20
20
21
- | | ns/op | allocation bytes | allocation times |
22
- | --- | --- | --- | --- |
23
- | std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
24
- | easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
25
- | jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
26
- | std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
27
- | easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
28
- | jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
21
+ | | ns/op | allocation bytes | allocation times |
22
+ | --------------- | ----------- | ---------------- | ------------- --- |
23
+ | std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
24
+ | easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
25
+ | jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
26
+ | std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
27
+ | easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
28
+ | jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
29
29
30
- Always benchmark with your own workload.
30
+ Always benchmark with your own workload.
31
31
The result depends heavily on the data input.
32
32
33
33
# Usage
@@ -41,10 +41,10 @@ import "encoding/json"
41
41
json.Marshal (&data)
42
42
```
43
43
44
- with
44
+ with
45
45
46
46
``` go
47
- import " github.com/json-iterator/go"
47
+ import jsoniter " github.com/json-iterator/go"
48
48
49
49
var json = jsoniter.ConfigCompatibleWithStandardLibrary
50
50
json.Marshal (&data)
@@ -60,7 +60,7 @@ json.Unmarshal(input, &data)
60
60
with
61
61
62
62
``` go
63
- import " github.com/json-iterator/go"
63
+ import jsoniter " github.com/json-iterator/go"
64
64
65
65
var json = jsoniter.ConfigCompatibleWithStandardLibrary
66
66
json.Unmarshal (input, &data)
@@ -78,10 +78,10 @@ go get github.com/json-iterator/go
78
78
79
79
Contributors
80
80
81
- * [ thockin] ( https://github.com/thockin )
82
- * [ mattn] ( https://github.com/mattn )
83
- * [ cch123] ( https://github.com/cch123 )
84
- * [ Oleg Shaldybin] ( https://github.com/olegshaldybin )
85
- * [ Jason Toffaletti] ( https://github.com/toffaletti )
81
+ - [ thockin] ( https://github.com/thockin )
82
+ - [ mattn] ( https://github.com/mattn )
83
+ - [ cch123] ( https://github.com/cch123 )
84
+ - [ Oleg Shaldybin] ( https://github.com/olegshaldybin )
85
+ - [ Jason Toffaletti] ( https://github.com/toffaletti )
86
86
87
87
Report issue or pull request, or email
[email protected] , or
[ ![ Gitter chat
] ( https://badges.gitter.im/gitterHQ/gitter.png )] ( https://gitter.im/json-iterator/Lobby )
0 commit comments