Skip to content

json-iterator/go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

71ac162 · Sep 15, 2022
Oct 24, 2018
Dec 20, 2019
Jan 17, 2020
Nov 28, 2019
Jul 19, 2021
Aug 6, 2020
Jun 10, 2019
May 8, 2020
Sep 15, 2022
Jul 7, 2017
Nov 30, 2017
Sep 7, 2017
Jul 1, 2018
Jul 1, 2018
Nov 30, 2016
Sep 11, 2021
May 21, 2019
Oct 24, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Feb 19, 2018
Mar 26, 2020
Feb 19, 2018
Feb 19, 2018
Nov 30, 2017
Jan 14, 2020
Jan 10, 2019
Jul 12, 2017
Aug 4, 2022
Aug 4, 2022
Dec 20, 2019
Oct 8, 2019
Nov 17, 2020
Nov 17, 2020
Jan 3, 2020
Jun 10, 2019
Oct 8, 2019
Feb 19, 2018
Nov 12, 2018
Feb 19, 2018
Jul 9, 2017
Apr 7, 2018
Nov 13, 2020
Feb 28, 2018
Feb 28, 2018
Mar 26, 2020
Feb 28, 2018
Jul 21, 2020
Sep 15, 2022
Aug 14, 2019
Jun 3, 2019
Mar 30, 2020
Feb 28, 2018
Aug 3, 2020
Nov 28, 2019
Jan 18, 2020
Sep 15, 2022
Feb 24, 2018
Feb 19, 2018
Jan 18, 2020
Feb 14, 2018

Repository files navigation

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/op allocation bytes allocation times
std decode 35510 ns/op 1960 B/op 99 allocs/op
easyjson decode 8499 ns/op 160 B/op 4 allocs/op
jsoniter decode 5623 ns/op 160 B/op 3 allocs/op
std encode 2213 ns/op 712 B/op 5 allocs/op
easyjson encode 883 ns/op 576 B/op 3 allocs/op
jsoniter encode 837 ns/op 384 B/op 4 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 Gitter chat