Debian Codegraph @

/

0 files · 0 symbols
README (full)

Sourcegraph GoDoc Build Status codecov rcard License Gitter chat

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

Benchmark

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 [email protected], or Gitter chat

dir any_tests/
dir api_tests/
dir benchmarks/
dir debian/
dir extension_tests/
dir extra/
dir misc_tests/
dir skip_tests/
dir type_tests/
dir value_tests/
file .codecov.yml
file .gitignore
file .travis.yml
file Gopkg.lock
file Gopkg.toml
file LICENSE
file README.md
file adapter.go
file any.go
file any_array.go
file any_bool.go
file any_float.go
file any_int32.go
file any_int64.go
file any_invalid.go
file any_nil.go
file any_number.go
file any_object.go
file any_str.go
file any_uint32.go
file any_uint64.go
file build.sh
file config.go
file example_test.go
file fuzzy_mode_convert_table.md
file go.mod
file go.sum
file iter.go
file iter_array.go
file iter_float.go
file iter_int.go
file iter_object.go
file iter_skip.go
file iter_skip_sloppy.go
file iter_skip_sloppy_test.go
file iter_skip_strict.go
file iter_str.go
file jsoniter.go
file pool.go
file reflect.go
file reflect_array.go
file reflect_dynamic.go
file reflect_extension.go
file reflect_json_number.go
file reflect_json_raw_message.go
file reflect_map.go
file reflect_marshaler.go
file reflect_native.go
file reflect_optional.go
file reflect_slice.go
file reflect_struct_decoder.go
file reflect_struct_encoder.go
file stream.go
file stream_float.go
file stream_int.go
file stream_str.go
file stream_test.go
file test.sh