Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

json-iterator/go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SourcegraphGoDocBuild StatuscodecovrcardLicenseGitter 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/opallocation bytesallocation times
std decode35510 ns/op1960 B/op99 allocs/op
easyjson decode8499 ns/op160 B/op4 allocs/op
jsoniter decode5623 ns/op160 B/op3 allocs/op
std encode2213 ns/op712 B/op5 allocs/op
easyjson encode883 ns/op576 B/op3 allocs/op
jsoniter encode837 ns/op384 B/op4 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"varjson=jsoniter.ConfigCompatibleWithStandardLibraryjson.Marshal(&data)

Replace

import"encoding/json"json.Unmarshal(input,&data)

with

import jsoniter"github.com/json-iterator/go"varjson=jsoniter.ConfigCompatibleWithStandardLibraryjson.Unmarshal(input,&data)

More documentation

How to get

go get github.com/json-iterator/go

Contribution Welcomed !

Contributors

Report issue or pull request, or emailtaowen@gmail.com, orGitter chat


[8]ページ先頭

©2009-2025 Movatter.jp