• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

any_tests/H06-Mar-2019-911748

api_tests/H06-Mar-2019-437377

benchmarks/H06-Mar-2019-185156

extension_tests/H06-Mar-2019-312269

extra/H06-Mar-2019-1,2031,043

misc_tests/H06-Mar-2019-1,1561,011

skip_tests/H06-Mar-2019-307277

type_tests/H06-Mar-2019-1,7351,555

value_tests/H06-Mar-2019-1,7031,553

.codecov.ymlH A D06-Mar-201933 42

.gitignoreH A D06-Mar-201942 54

.travis.ymlH A D06-Mar-2019159 1510

Gopkg.lockH A D06-Mar-2019588 2217

Gopkg.tomlH A D06-Mar-2019712 2724

LICENSEH A D06-Mar-20191 KiB2217

README.mdH A D06-Mar-20192.8 KiB8860

adapter.goH A D06-Mar-20194.5 KiB15194

any.goH A D06-Mar-20197 KiB326282

any_array.goH A D06-Mar-20194.7 KiB279239

any_bool.goH A D06-Mar-20191.8 KiB138103

any_float.goH A D06-Mar-20191.2 KiB8465

any_int32.goH A D06-Mar-20191.1 KiB7556

any_int64.goH A D06-Mar-20191.1 KiB7556

any_invalid.goH A D06-Mar-20191.3 KiB8362

any_nil.goH A D06-Mar-2019916 7052

any_number.goH A D06-Mar-20192.6 KiB124106

any_object.goH A D06-Mar-20196.8 KiB375311

any_str.goH A D06-Mar-20192.8 KiB167133

any_uint32.goH A D06-Mar-20191.1 KiB7556

any_uint64.goH A D06-Mar-20191.1 KiB7556

build.shH A D06-Mar-2019381 1310

config.goH A D06-Mar-201910.3 KiB376321

example_test.goH A D06-Mar-20192.6 KiB12298

fuzzy_mode_convert_table.mdH A D06-Mar-2019927 77

iter.goH A D06-Mar-20197.1 KiB323277

iter_array.goH A D06-Mar-20191.2 KiB5954

iter_float.goH A D06-Mar-20197.4 KiB340310

iter_int.goH A D06-Mar-20198.5 KiB346314

iter_object.goH A D06-Mar-20195.8 KiB252239

iter_skip.goH A D06-Mar-20193.2 KiB130113

iter_skip_sloppy.goH A D06-Mar-20192.9 KiB145119

iter_skip_sloppy_test.goH A D06-Mar-20193.1 KiB163154

iter_skip_strict.goH A D06-Mar-20192 KiB10090

iter_str.goH A D06-Mar-20194.7 KiB216197

jsoniter.goH A D06-Mar-2019884 191

pool.goH A D06-Mar-2019956 4333

reflect.goH A D06-Mar-20198.4 KiB333286

reflect_array.goH A D06-Mar-20192.6 KiB10592

reflect_dynamic.goH A D06-Mar-20191.4 KiB7162

reflect_extension.goH A D06-Mar-201914.2 KiB484384

reflect_json_number.goH A D06-Mar-20192.6 KiB11392

reflect_json_raw_message.goH A D06-Mar-20191.6 KiB6148

reflect_map.goH A D06-Mar-20198.9 KiB339314

reflect_marshaler.goH A D06-Mar-20195.6 KiB218196

reflect_native.goH A D06-Mar-201910.8 KiB452394

reflect_optional.goH A D06-Mar-20193.4 KiB134109

reflect_slice.goH A D06-Mar-20192.6 KiB10090

reflect_struct_decoder.goH A D06-Mar-201928.1 KiB1,0491,010

reflect_struct_encoder.goH A D06-Mar-20195.1 KiB211188

stream.goH A D06-Mar-20195.2 KiB212150

stream_float.goH A D06-Mar-20192.2 KiB9581

stream_int.goH A D06-Mar-20194.5 KiB191166

stream_str.goH A D06-Mar-20197.8 KiB373328

stream_test.goH A D06-Mar-20191.9 KiB7060

test.shH A D06-Mar-2019285 139

README.md

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)
3[![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go)
4[![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go)
5[![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go)
6[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE)
7[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
8
9A high-performance 100% compatible drop-in replacement of "encoding/json"
10
11You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go)
12
13# Benchmark
14
15![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png)
16
17Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go
18
19Raw Result (easyjson requires static code generation)
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 |
29
30Always benchmark with your own workload.
31The result depends heavily on the data input.
32
33# Usage
34
35100% compatibility with standard lib
36
37Replace
38
39```go
40import "encoding/json"
41json.Marshal(&data)
42```
43
44with
45
46```go
47import "github.com/json-iterator/go"
48
49var json = jsoniter.ConfigCompatibleWithStandardLibrary
50json.Marshal(&data)
51```
52
53Replace
54
55```go
56import "encoding/json"
57json.Unmarshal(input, &data)
58```
59
60with
61
62```go
63import "github.com/json-iterator/go"
64
65var json = jsoniter.ConfigCompatibleWithStandardLibrary
66json.Unmarshal(input, &data)
67```
68
69[More documentation](http://jsoniter.com/migrate-from-go-std.html)
70
71# How to get
72
73```
74go get github.com/json-iterator/go
75```
76
77# Contribution Welcomed !
78
79Contributors
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)
86
87Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
88