暫無描述

Tao Wen d09e2419ba update benchmark 8 年之前
assert 101dfdbb2a fix 4 fields object decoding 9 年之前
require 101dfdbb2a fix 4 fields object decoding 9 年之前
LICENSE 923358c07e Initial commit 9 年之前
README.md d09e2419ba update benchmark 8 年之前
example_test.go 5b27aaa62c update test 8 年之前
feature_adapter.go a4e5abf492 support []byte; marshal without copy 8 年之前
feature_any.go 53f8d370b5 fix wrap any 8 年之前
feature_any_array.go bf459b9a49 object lazy any support get all 8 年之前
feature_any_bool.go edb96991a8 add all integer types 8 年之前
feature_any_float.go edb96991a8 add all integer types 8 年之前
feature_any_int32.go edb96991a8 add all integer types 8 年之前
feature_any_int64.go edb96991a8 add all integer types 8 年之前
feature_any_invalid.go edb96991a8 add all integer types 8 年之前
feature_any_nil.go 9d1feb5431 fix tests 8 年之前
feature_any_object.go e36f926072 fix random go test failure 8 年之前
feature_any_string.go edb96991a8 add all integer types 8 年之前
feature_any_uint32.go edb96991a8 add all integer types 8 年之前
feature_any_uint64.go edb96991a8 add all integer types 8 年之前
feature_iter.go 8656482625 array lazy fill and full fill 8 年之前
feature_iter_array.go 928bc4ce72 ReadArrayCB 9 年之前
feature_iter_float.go fe9fa8900e #31 support json.RawMessage 8 年之前
feature_iter_int.go da7ed7809b use hash for field dispatching 8 年之前
feature_iter_object.go e5a1e704ad #25 make fielding binding case insensitive 8 年之前
feature_iter_skip.go 7d2ae80c37 #27 support json.Unmarshaler 8 年之前
feature_iter_string.go 7e046e6aa7 simplify read string, and support null 8 年之前
feature_reflect.go a4e5abf492 support []byte; marshal without copy 8 年之前
feature_reflect_array.go 5488fde97f fix one field struct interface{} optimization compatibility 8 年之前
feature_reflect_map.go 3979955e69 support TextMarshaler as map key 8 年之前
feature_reflect_native.go a4e5abf492 support []byte; marshal without copy 8 年之前
feature_reflect_object.go 59e71bacc8 #36 handle anonymous 8 年之前
feature_stream.go dcb78991c4 flush when buffer is large enough 8 年之前
feature_stream_float.go a4e5abf492 support []byte; marshal without copy 8 年之前
feature_stream_int.go a4e5abf492 support []byte; marshal without copy 8 年之前
jsoniter_adapter_test.go 45bbb40a9f #34 implement NewEncoder 8 年之前
jsoniter_array_test.go a4e5abf492 support []byte; marshal without copy 8 年之前
jsoniter_base64_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. 9 年之前
jsoniter_bool_test.go 38d613acf2 bool any 8 年之前
jsoniter_customize_test.go a4e5abf492 support []byte; marshal without copy 8 年之前
jsoniter_demo_test.go 87149ae489 add simple marshal benchmark 8 年之前
jsoniter_find_end_test.go 9d1feb5431 fix tests 8 年之前
jsoniter_float_test.go 377b892102 support big float and int 8 年之前
jsoniter_int_test.go ad3a7fde32 #30 support json.Number 8 年之前
jsoniter_interface_test.go e36f926072 fix random go test failure 8 年之前
jsoniter_io_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. 9 年之前
jsoniter_large_file_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. 9 年之前
jsoniter_map_test.go 3979955e69 support TextMarshaler as map key 8 年之前
jsoniter_nested_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. 9 年之前
jsoniter_null_test.go fc44cb2d91 #26 do not enforce pointer as optional 8 年之前
jsoniter_object_test.go e36f926072 fix random go test failure 8 年之前
jsoniter_optional_test.go e36f926072 fix random go test failure 8 年之前
jsoniter_reflect_native_test.go 5b0609f901 support int/string encode 9 年之前
jsoniter_reflect_struct_test.go e36f926072 fix random go test failure 8 年之前
jsoniter_reflect_test.go 5b2a731963 implement readFloat32 fast path 9 年之前
jsoniter_skip_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. 9 年之前
jsoniter_stream_test.go a4e5abf492 support []byte; marshal without copy 8 年之前
jsoniter_string_test.go fa16f3c75c wrap string 8 年之前

README.md

rcard

jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go

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

Usage

100% compatibility with standard lib

Replace

import "encoding/json"
json.Marshal(&data)

with

import "github.com/json-iterator/go"
jsoniter.Marshal(&data)

Replace

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

with

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

How to get

go get github.com/json-iterator/go

Contribution Welcomed !

Report issue or pull request, or email taowen@gmail.com, or Gitter chat