MIT License

项目介绍

json-iterator/go 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 13.9k 个 Star、1.0k 次 Fork。

仓库全名
json-iterator/go
开源许可证
MIT License
Star 数
13.9k
Fork 数
1.0k
未关闭 Issue
208

README 摘要

A high-performance 100% compatible drop-in replacement of "encoding/json" Benchmark Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmarkmediumpayloadtest.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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

go 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 13.9k 个 Star。

go 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 go 的源码?

可以直接克隆仓库:git clone https://github.com/json-iterator/go.git,默认分支为 master;安装与运行步骤见仓库 README。

go 最近还在维护吗?

仓库最近一次更新为 2024年5月27日,当前有 208 个未关闭 Issue;Star 数为 13.9k,可作为社区活跃度的参考。

简要分析

热度分
15918
价值分
8610
活跃状态
归档

语言占比

Go
Shell

Release

README

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

评论

暂无评论