MyGit

json-iterator/go

Fork: 1018 Star: 13106 (更新于 2024-05-20 06:24:46)

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-05-26 09:35:59)

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-07-02 03:42:28 restic/restic

2024-07-01 17:47:51 moby/moby

2024-06-24 17:25:20 SagerNet/sing-box

2024-06-21 20:12:19 zeromicro/go-zero

2024-06-21 19:17:49 daytonaio/daytona

2024-06-19 00:23:35 pocketbase/pocketbase