MyGit

json-iterator/go

Fork: 1026 Star: 13415 (更新于 2024-10-30 03:19:07)

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-11-06 07:46:48 dolthub/dolt

2024-11-06 03:37:39 containerd/containerd

2024-11-05 20:42:00 aurora-develop/aurora

2024-11-05 08:55:31 XTLS/Xray-core

2024-11-05 00:03:47 SagerNet/sing-box

2024-11-04 20:34:19 Permify/permify