go-json/README.md

2.1 KiB

go-json

Go GoDoc

Fast JSON encoder/decoder compatible with encoding/json for Go

Installation

go get github.com/goccy/go-json

How to use

Replace import statement from encoding/json to github.com/goccy/go-json

-import "encoding/json"
+import "github.com/goccy/go-json"

Benchmarks

$ cd benchmarks
$ go test -bench .

Encode

Fastest

SmallStruct

MediumStruct

LargeStruct

Decode

So faster than json-iterator/go

json.Unmarshal

SmallStruct

MediumStruct

LargeStruct

Stream Decode

SmallStruct

MediumStruct

LargeStruct

Status

Type

Currently supported all types

API

Implements All APIs

Error

  • InvalidUTF8Error
  • InvalidUnmarshalError
  • MarshalerError
  • SyntaxError
  • UnmarshalFieldError
  • UnmarshalTypeError
  • UnsupportedTypeError
  • UnsupportedValueError

License

MIT