Fast JSON encoder/decoder compatible with encoding/json for Go
go get github.com/goccy/go-json
Replace import statement from encoding/json
to github.com/goccy/go-json
-import "encoding/json"
+import "github.com/goccy/go-json"
$ cd benchmarks
$ go test -bench .
Fastest
So faster than json-iterator/go
Currently supported all types
-
Compact
-
HTMLEscape
-
Indent
-
Marshal
-
MarshalIndent
-
Unmarshal
-
Valid
-
NewDecoder
-
(*Decoder).Buffered
-
(*Decoder).Decode
-
(*Decoder).DisallowUnknownFields
-
(*Decoder).InputOffset
-
(*Decoder).More
-
(*Decoder).Token
-
(*Decoder).UseNumber
-
Delim
-
(Delim).String
-
NewEncoder
-
(*Encoder).Encode
-
(*Encoder).SetEscapeHTML
-
(*Encoder).SetIndent
-
InvalidUTF8Error
-
InvalidUnmarshalError
-
MarshalerError
-
SyntaxError
-
UnmarshalFieldError
-
UnmarshalTypeError
-
UnsupportedTypeError
-
UnsupportedValueError
MIT