Нема описа

Tao Wen 787edc95b0 Revert "WIP: Tests to compare against stdlib" пре 7 година
.idea b0c9f047e2 test more than one pakcage description пре 7 година
assert cfffa29c8a gofmt пре 7 година
require 101dfdbb2a fix 4 fields object decoding пре 7 година
LICENSE 923358c07e Initial commit пре 8 година
README.md d09e2419ba update benchmark пре 7 година
example_test.go 962c470806 fix import not use пре 7 година
feature_adapter.go cee09816e3 decoder/encoder;float precision doc пре 7 година
feature_any.go 53f8d370b5 fix wrap any пре 7 година
feature_any_array.go cfffa29c8a gofmt пре 7 година
feature_any_bool.go edb96991a8 add all integer types пре 7 година
feature_any_float.go cfffa29c8a gofmt пре 7 година
feature_any_int32.go cfffa29c8a gofmt пре 7 година
feature_any_int64.go cfffa29c8a gofmt пре 7 година
feature_any_invalid.go edb96991a8 add all integer types пре 7 година
feature_any_nil.go cfffa29c8a gofmt пре 7 година
feature_any_object.go cfffa29c8a gofmt пре 7 година
feature_any_string.go cfffa29c8a gofmt пре 7 година
feature_any_uint32.go edb96991a8 add all integer types пре 7 година
feature_any_uint64.go cfffa29c8a gofmt пре 7 година
feature_iter.go cdbad22d22 test more package description пре 7 година
feature_iter_array.go cfffa29c8a gofmt пре 7 година
feature_iter_float.go cfffa29c8a gofmt пре 7 година
feature_iter_int.go cfffa29c8a gofmt пре 7 година
feature_iter_object.go 3307ce3ba2 #50 map key unlike object field, can contain escaped char пре 7 година
feature_iter_skip.go cfffa29c8a gofmt пре 7 година
feature_iter_string.go 26708bccc9 report error when string end not found пре 7 година
feature_reflect.go 6f50f15678 decoder/encoder;float precision doc пре 7 година
feature_reflect_array.go cfffa29c8a gofmt пре 7 година
feature_reflect_map.go 3307ce3ba2 #50 map key unlike object field, can contain escaped char пре 7 година
feature_reflect_native.go 84ad508437 #48 should return error if concrete tpye unknown пре 7 година
feature_reflect_object.go cfffa29c8a gofmt пре 7 година
feature_stream.go cfffa29c8a gofmt пре 7 година
feature_stream_float.go cee09816e3 decoder/encoder;float precision doc пре 7 година
feature_stream_int.go cfffa29c8a gofmt пре 7 година
jsoniter_adapter_test.go cfffa29c8a gofmt пре 7 година
jsoniter_array_test.go cfffa29c8a gofmt пре 7 година
jsoniter_base64_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. пре 7 година
jsoniter_bool_test.go cfffa29c8a gofmt пре 7 година
jsoniter_customize_test.go cfffa29c8a gofmt пре 7 година
jsoniter_demo_test.go cfffa29c8a gofmt пре 7 година
jsoniter_find_end_test.go cfffa29c8a gofmt пре 7 година
jsoniter_float_test.go d75b539bad add test for scientific float пре 7 година
jsoniter_int_test.go cfffa29c8a gofmt пре 7 година
jsoniter_interface_test.go 84ad508437 #48 should return error if concrete tpye unknown пре 7 година
jsoniter_io_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. пре 7 година
jsoniter_large_file_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. пре 7 година
jsoniter_map_test.go 3307ce3ba2 #50 map key unlike object field, can contain escaped char пре 7 година
jsoniter_nested_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. пре 7 година
jsoniter_null_test.go cfffa29c8a gofmt пре 7 година
jsoniter_object_test.go cfffa29c8a gofmt пре 7 година
jsoniter_optional_test.go cfffa29c8a gofmt пре 7 година
jsoniter_reflect_native_test.go cfffa29c8a gofmt пре 7 година
jsoniter_reflect_struct_test.go cfffa29c8a gofmt пре 7 година
jsoniter_reflect_test.go cfffa29c8a gofmt пре 7 година
jsoniter_skip_test.go d63a00f0bf Formated, doced. Also fixed few minor bugs. пре 7 година
jsoniter_stream_test.go cfffa29c8a gofmt пре 7 година
jsoniter_string_test.go 84ad508437 #48 should return error if concrete tpye unknown пре 7 година

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