MyGit

json-iterator/go

Fork: 1030 Star: 13484 (更新于 2024-12-16 07:15:39)

license: MIT

Language: Go .

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

最后发布版本: v1.1.12 ( 2021-09-11 10:19:57)

官方网址 GitHub网址

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

最近版本更新:(数据更新于 2024-10-24 23:47:05)

2021-09-11 10:19:57 v1.1.12

2021-04-28 10:30:11 v1.1.11

2020-06-09 15:44:37 v1.1.10

2019-12-21 11:12:22 v1.1.9

2019-10-30 08:37:01 v1.1.8

2019-10-17 08:09:06 1.1.8

2019-07-24 18:41:34 v1.1.7

2019-03-12 22:38:52 v1.1.6

2018-08-25 22:08:27 v1.1.5

2018-08-06 14:26:42 1.1.5

主题(topics):

deserialization, go, golang, json, json-parser, parser, serialization, serializer

json-iterator/go同语言 Go最近更新仓库

2024-12-22 07:52:58 navidrome/navidrome

2024-12-21 20:15:12 SagerNet/sing-box

2024-12-21 03:25:54 SpecterOps/BloodHound

2024-12-19 23:11:24 shadow1ng/fscan

2024-12-19 21:50:56 minio/minio

2024-12-19 10:04:39 istio/istio