Fast JSON encoder/decoder compatible with encoding/json for Go
Go to file
Masaaki Goshima 00886d93f1 Add coverage job 2020-12-30 18:06:43 +09:00
.github/workflows Add coverage job 2020-12-30 18:06:43 +09:00
benchmarks Add segmentio/encoding/json to benchmark of decoder 2020-12-24 20:20:26 +09:00
cmd/generator Refactor generated code 2020-12-30 16:13:33 +09:00
LICENSE Initial commit 2020-04-19 18:32:37 +09:00
README.md Update README.md 2020-12-27 21:28:10 +09:00
compact.go Fix MarshalJSON/MarshalText 2020-08-18 13:36:36 +09:00
decode.go Fix read timing and test case 2020-12-07 11:40:03 +09:00
decode_anonymous_field.go Remove debug log 2020-12-24 18:45:04 +09:00
decode_array.go Fix array decoder 2020-12-24 23:14:58 +09:00
decode_bool.go Fix error case 2020-12-24 18:30:11 +09:00
decode_bytes.go Fix decoding of []byte type 2020-12-24 19:36:49 +09:00
decode_compile.go Fix []byte with unmarshaler 2020-12-24 14:26:18 +09:00
decode_context.go Fix skipValue 2020-11-27 17:41:47 +09:00
decode_float.go Fix streaming decoder for float value 2020-12-27 20:42:43 +09:00
decode_int.go Fix UnmarshalTypeError 2020-12-24 17:47:53 +09:00
decode_interface.go Fix decoding of embeded struct 2020-12-22 21:55:59 +09:00
decode_map.go Fix decoding of embeded struct 2020-12-22 21:55:59 +09:00
decode_number.go Fix stream decoding 2020-12-05 22:27:33 +09:00
decode_ptr.go Assign nil at null value 2020-12-23 01:29:13 +09:00
decode_slice.go Merge branch 'master' of github.com:goccy/go-json into feature/fix-decoder 2020-12-23 01:37:54 +09:00
decode_stream.go Add test cases 2020-12-24 20:08:27 +09:00
decode_string.go Fix []byte with unmarshaler 2020-12-24 14:26:18 +09:00
decode_struct.go Fix UnmarshalTypeError 2020-12-24 17:47:53 +09:00
decode_test.go Fix decoder by using checkptr flag 2020-12-24 21:52:40 +09:00
decode_uint.go Fix overflow handling for int/uint decoder 2020-12-21 15:48:57 +09:00
decode_unmarshal_json.go Fix UnmarshalTypeError for int decoder 2020-12-15 12:29:19 +09:00
decode_unmarshal_text.go Add error handling for unmarshal text 2020-12-24 18:45:26 +09:00
decode_wrapped_string.go Fix overflow handling for int/uint decoder 2020-12-21 15:48:57 +09:00
encode.go Add optimized StructEnd operation to vm 2020-12-29 23:17:39 +09:00
encode_compile.go Fix runtime error 2020-12-30 01:29:29 +09:00
encode_context.go Refactor indent code 2020-12-25 17:03:56 +09:00
encode_int.go Replace int/uint encoding implementation 2020-12-20 04:02:03 +09:00
encode_map112.go Fix build 2020-04-26 12:49:54 +09:00
encode_map113.go Fix build 2020-04-26 12:49:54 +09:00
encode_opcode.go Add StructEnd to code type 2020-12-30 00:13:45 +09:00
encode_optype.go Refactor generated code 2020-12-30 16:13:33 +09:00
encode_string.go Expand source for string encoding 2020-12-20 04:02:03 +09:00
encode_test.go Omit Parallel execution of test case 2020-12-24 20:38:42 +09:00
encode_vm.go Fix runtime error 2020-12-30 01:29:29 +09:00
error.go Fix error case 2020-12-24 18:30:11 +09:00
example_marshaling_test.go Add examples 2020-08-27 21:02:44 +09:00
example_test.go Omit map example because currently cannot sort map by keys 2020-08-27 21:13:36 +09:00
example_text_marshaling_test.go Fix pointer fields 2020-09-17 21:50:27 +09:00
export_test.go Add test cases for MarshalJSON and MarshalText 2020-08-19 00:32:45 +09:00
go.mod Removed dependency on xerrors 2020-05-09 01:49:37 +09:00
go.sum Removed dependency on xerrors 2020-05-09 01:49:37 +09:00
helper_test.go Fix null value for struct field 2020-08-08 13:20:42 +09:00
indent.go Fix encoding for Indent/MarshalIndent 2020-08-27 21:01:53 +09:00
json.go Merge branch 'master' of github.com:goccy/go-json into feature/fix-decoder 2020-12-23 01:37:54 +09:00
json_test.go Omit Parallel execution of test case 2020-12-24 20:38:42 +09:00
number_test.go Add test cases 2020-08-25 00:56:23 +09:00
option.go Add option.go 2020-09-16 18:23:43 +09:00
rtype.go Fix MarshalJSON/MarshalText 2020-08-18 13:36:36 +09:00
stream_test.go Fix streaming decoder for float value 2020-12-27 20:42:43 +09:00
struct_field.go Fix stream encoding 2020-09-17 01:26:39 +09:00
tagkey_test.go Fix test case 2020-09-17 10:53:39 +09:00

README.md

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

Decode

So faster than json-iterator/go

json.Unmarshal

SmallStruct

MediumStruct

LargeStruct

Stream Decode

SmallStruct

MediumStruct

LargeStruct

License

MIT