any_tests
fix #313 support json marshaller type as map key
api_tests
Revert "Merge pull request #418 from bbrks/configurable_maxDepth"
benchmarks
benchmarks: add benchmark for Stream
extension_tests
fix nil attachment on stream in custom encoder on sorted map
extra
fix: invalid unicode while binary to string
misc_tests
jsoniter: Fix errors during reading integers from chunked io.Reader (#477)
skip_tests
fix #37: add SkipAndAppendBytes iterator method
type_tests
disable map_key_test temporarily
value_tests
encoding/json: use standard ES6 formatting for numbers during marshal
.codecov.yml
import github.com/stretchr/testify/require
.gitignore
fix #198, use dep for vendoring
.travis.yml
travis: add 1.x to go versions
adapter.go
Fix typo in UnmarshalFromString documentation
any_array.go
remove feature prefix
any_bool.go
remove feature prefix
any_float.go
remove feature prefix
any_int32.go
remove feature prefix
any_int64.go
remove feature prefix
any_invalid.go
remove feature prefix
any_nil.go
remove feature prefix
any_number.go
remove feature prefix
any_object.go
remove feature prefix
any_str.go
fix any str ToInt64 ToUint64 panic
any_uint32.go
remove feature prefix
any_uint64.go
remove feature prefix
any.go
fix #311 handle nil any
build.sh
fix #198, use dep for vendoring
config.go
fix issue #389 #411
example_test.go
rename ExampleMyKey
fuzzy_mode_convert_table.md
update conversion table
go.mod
bumped stretchr to v1.8.0 to get rid of yaml v2 vuln
go.sum
bumped stretchr to v1.8.0 to get rid of yaml v2 vuln
Gopkg.lock
add tests for #283
Gopkg.toml
add tests for #283
iter_array.go
Limit nesting depth
iter_float.go
fix issue 510
iter_int.go
fix issue 510
iter_object.go
fix the error message typo of ReadObjectCB & ReadMapCb function
iter_skip_sloppy_test.go
remove feature prefix
iter_skip_sloppy.go
Limit nesting depth
iter_skip_strict.go
fix #317, try parse as BigFloat if overflow
iter_skip.go
fix #37: add SkipAndAppendBytes iterator method
iter_str.go
remove feature prefix
iter.go
Revert "Merge pull request #418 from bbrks/configurable_maxDepth"
jsoniter.go
document public symbols
LICENSE
Initial commit
pool.go
Release writer to enable GC
README.md
fix go 1.18 compatibility
reflect_array.go
move reflect2 from plz to modern-go
reflect_dynamic.go
move reflect2 from plz to modern-go
reflect_extension.go
fix issue #449
reflect_json_number.go
move reflect2 from plz to modern-go
reflect_json_raw_message.go
fix issue #469
reflect_map.go
encoding/json: allow non-string type keys for (un-)marshal
reflect_marshaler.go
use json.Marshaler then trim the last '\n' in reflect_marshaler
reflect_native.go
Don't marshal empty byte or uint8 slice as null
reflect_optional.go
temporarily comment out some test case to fix the CI fail since go1.14 released
reflect_slice.go
move reflect2 from plz to modern-go
reflect_struct_decoder.go
fixed null in number json tag string (#480)
reflect_struct_encoder.go
fix nil attachment on stream in custom encoder on sorted map
reflect.go
fix issue 508
stream_float.go
encoding/json: use standard ES6 formatting for numbers during marshal
stream_int.go
gofmt
stream_str.go
remove feature prefix
stream_test.go
(*Stream).WriteMore: remove implicit Flush
stream.go
(*Stream).WriteMore: remove implicit Flush
test.sh
fix coverage

A high-performance 100% compatible drop-in replacement of "encoding/json"

Benchmark

Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go

Raw Result (easyjson requires static code generation)

ns/opallocation bytesallocation times
std decode35510 ns/op1960 B/op99 allocs/op
easyjson decode8499 ns/op160 B/op4 allocs/op
jsoniter decode5623 ns/op160 B/op3 allocs/op
std encode2213 ns/op712 B/op5 allocs/op
easyjson encode883 ns/op576 B/op3 allocs/op
jsoniter encode837 ns/op384 B/op4 allocs/op

Always benchmark with your own workload. The result depends heavily on the data input.

Usage

100% compatibility with standard lib

Replace

import "encoding/json"
json.Marshal(&data)

with

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Marshal(&data)

Replace

import "encoding/json"
json.Unmarshal(input, &data)

with

import jsoniter "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Unmarshal(input, &data)

More documentation

How to get

go get github.com/json-iterator/go

Contribution Welcomed !

Contributors

Report issue or pull request, or email taowen@gmail.com, or