Update README.md
1 file changed
tree: e082bf0b944c55300538958edea675dc94d67bb2
  1. extra/
  2. output_tests/
  3. skip_tests/
  4. .codecov.yml
  5. .gitignore
  6. .travis.yml
  7. build.sh
  8. compatible_test.go
  9. example_test.go
  10. feature_adapter.go
  11. feature_any.go
  12. feature_any_array.go
  13. feature_any_bool.go
  14. feature_any_float.go
  15. feature_any_int32.go
  16. feature_any_int64.go
  17. feature_any_invalid.go
  18. feature_any_nil.go
  19. feature_any_number.go
  20. feature_any_object.go
  21. feature_any_string.go
  22. feature_any_uint32.go
  23. feature_any_uint64.go
  24. feature_config.go
  25. feature_config_with_sync_map.go
  26. feature_config_without_sync_map.go
  27. feature_iter.go
  28. feature_iter_array.go
  29. feature_iter_float.go
  30. feature_iter_int.go
  31. feature_iter_object.go
  32. feature_iter_skip.go
  33. feature_iter_skip_sloppy.go
  34. feature_iter_skip_strict.go
  35. feature_iter_string.go
  36. feature_json_number.go
  37. feature_pool.go
  38. feature_reflect.go
  39. feature_reflect_array.go
  40. feature_reflect_extension.go
  41. feature_reflect_map.go
  42. feature_reflect_native.go
  43. feature_reflect_object.go
  44. feature_reflect_optional.go
  45. feature_reflect_slice.go
  46. feature_reflect_struct_decoder.go
  47. feature_stream.go
  48. feature_stream_float.go
  49. feature_stream_int.go
  50. feature_stream_string.go
  51. fuzzy_mode_convert_table.md
  52. Gopkg.lock
  53. Gopkg.toml
  54. jsoniter.go
  55. jsoniter_1dot8_only_test.go
  56. jsoniter_adapter_test.go
  57. jsoniter_alias_test.go
  58. jsoniter_any_array_test.go
  59. jsoniter_any_bool_test.go
  60. jsoniter_any_float_test.go
  61. jsoniter_any_int_test.go
  62. jsoniter_any_map_test.go
  63. jsoniter_any_null_test.go
  64. jsoniter_any_object_test.go
  65. jsoniter_any_string_test.go
  66. jsoniter_array_test.go
  67. jsoniter_bool_test.go
  68. jsoniter_customize_test.go
  69. jsoniter_demo_test.go
  70. jsoniter_encode_interface_test.go
  71. jsoniter_enum_marshaler_test.go
  72. jsoniter_fixed_array_test.go
  73. jsoniter_float_test.go
  74. jsoniter_int_test.go
  75. jsoniter_interface_test.go
  76. jsoniter_invalid_test.go
  77. jsoniter_io_test.go
  78. jsoniter_iterator_test.go
  79. jsoniter_large_file_test.go
  80. jsoniter_map_test.go
  81. jsoniter_must_be_valid_test.go
  82. jsoniter_nested_test.go
  83. jsoniter_null_test.go
  84. jsoniter_object_test.go
  85. jsoniter_optional_test.go
  86. jsoniter_raw_message_test.go
  87. jsoniter_reader_test.go
  88. jsoniter_reflect_native_test.go
  89. jsoniter_skip_test.go
  90. jsoniter_sloppy_test.go
  91. jsoniter_stream_test.go
  92. jsoniter_string_test.go
  93. jsoniter_struct_decoder_test.go
  94. jsoniter_struct_encoder_test.go
  95. jsoniter_wrap_test.go
  96. LICENSE
  97. README.md
  98. test.sh
  99. unmarshal_input_test.go
README.md

Sourcegraph GoDoc Build Status codecov rcard License Gitter chat

A high-performance 100% compatible drop-in replacement of “encoding/json”

You can also use thrift like JSON using thrift-iterator

Go开发者们请加入我们,滴滴出行平台技术部 taowen@didichuxing.com

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/opallocation bytesallocation times
std decode35510 ns/op1960 B/op99 allocs/op
easyjson decode8499 ns/op160 B/op4 allocs/op
jsoniter decode5623 ns/op160 B/op3 allocs/op
std encode2213 ns/op712 B/op5 allocs/op
easyjson encode883 ns/op576 B/op3 allocs/op
jsoniter encode837 ns/op384 B/op4 allocs/op

Usage

100% compatibility with standard lib

Replace

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

with

import "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Marshal(&data)

Replace

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

with

import "github.com/json-iterator/go"

var json = jsoniter.ConfigCompatibleWithStandardLibrary
json.Unmarshal(input, &data)

More documentation

How to get

go get github.com/json-iterator/go

Contribution Welcomed !

Contributors

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