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

..18-Oct-2020-

skip_tests/H18-Oct-2020-

.codecov.ymlH A D18-Oct-202033 42

.gitignoreH A D18-Oct-202033 43

.travis.ymlH A D18-Oct-2020151 149

LICENSEH A D18-Oct-20201 KiB2217

README.mdH A D18-Oct-20202.5 KiB8156

feature_adapter.goH A D18-Oct-20203.7 KiB12877

feature_any.goH A D18-Oct-20205.3 KiB243209

feature_any_array.goH A D18-Oct-20204.7 KiB279239

feature_any_bool.goH A D18-Oct-20201.8 KiB138103

feature_any_float.goH A D18-Oct-20201.2 KiB8465

feature_any_int32.goH A D18-Oct-20201.1 KiB7556

feature_any_int64.goH A D18-Oct-20201.1 KiB7556

feature_any_invalid.goH A D18-Oct-20201.3 KiB8362

feature_any_nil.goH A D18-Oct-2020916 7052

feature_any_number.goH A D18-Oct-20202.1 KiB10587

feature_any_object.goH A D18-Oct-20206.8 KiB375311

feature_any_string.goH A D18-Oct-20202.8 KiB167133

feature_any_uint32.goH A D18-Oct-20201.1 KiB7556

feature_any_uint64.goH A D18-Oct-20201.1 KiB7556

feature_config.goH A D18-Oct-20208.4 KiB313261

feature_iter.goH A D18-Oct-20206.7 KiB308262

feature_iter_array.goH A D18-Oct-20201.2 KiB5954

feature_iter_float.goH A D18-Oct-20207.4 KiB342314

feature_iter_int.goH A D18-Oct-20206.2 KiB259230

feature_iter_object.goH A D18-Oct-20204.6 KiB213200

feature_iter_skip.goH A D18-Oct-20203.1 KiB128111

feature_iter_skip_sloppy.goH A D18-Oct-20202.9 KiB145119

feature_iter_skip_strict.goH A D18-Oct-20201.8 KiB9080

feature_iter_string.goH A D18-Oct-20204.6 KiB216197

feature_json_number.goH A D18-Oct-2020269 1612

feature_pool.goH A D18-Oct-20201.1 KiB5848

feature_reflect.goH A D18-Oct-202020.1 KiB692627

feature_reflect_array.goH A D18-Oct-20202.6 KiB10088

feature_reflect_extension.goH A D18-Oct-202011.8 KiB414345

feature_reflect_map.goH A D18-Oct-20207.1 KiB245220

feature_reflect_native.goH A D18-Oct-202017.1 KiB673533

feature_reflect_object.goH A D18-Oct-20204.9 KiB197179

feature_reflect_slice.goH A D18-Oct-20203.7 KiB150132

feature_reflect_struct_decoder.goH A D18-Oct-202025.1 KiB917888

feature_stream.goH A D18-Oct-20206.8 KiB306242

feature_stream_float.goH A D18-Oct-20202.1 KiB9783

feature_stream_int.goH A D18-Oct-20206.7 KiB321296

feature_stream_string.goH A D18-Oct-20208.2 KiB397352

fuzzy_mode_convert_table.mdH A D18-Oct-2020927 77

jsoniter.goH A D18-Oct-2020884 191

test.shH A D18-Oct-2020247 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
11```
12Go开发者们请加入我们,滴滴出行平台技术部 taowen@didichuxing.com
13```
14
15# Benchmark
16
17![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png)
18
19Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go
20
21Raw Result (easyjson requires static code generation)
22
23| | ns/op | allocation bytes | allocation times |
24| --- | --- | --- | --- |
25| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
26| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
27| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
28| std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
29| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
30| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
31
32# Usage
33
34100% compatibility with standard lib
35
36Replace
37
38```go
39import "encoding/json"
40json.Marshal(&data)
41```
42
43with
44
45```go
46import "github.com/json-iterator/go"
47jsoniter.Marshal(&data)
48```
49
50Replace
51
52```go
53import "encoding/json"
54json.Unmarshal(input, &data)
55```
56
57with
58
59```go
60import "github.com/json-iterator/go"
61jsoniter.Unmarshal(input, &data)
62```
63
64[More documentation](http://jsoniter.com/migrate-from-go-std.html)
65
66# How to get
67
68```
69go get github.com/json-iterator/go
70```
71
72# Contribution Welcomed !
73
74Contributors
75
76* [thockin](https://github.com/thockin)
77* [mattn](https://github.com/mattn)
78* [cch123](https://github.com/cch123)
79
80Report 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)
81