From 3f87e8c8a717a360880ea2912f4ac4724f7c4a84 Mon Sep 17 00:00:00 2001 From: "duanyi.aster" Date: Mon, 30 Dec 2024 20:50:14 +0800 Subject: [PATCH] doc: introduce "cloudwego/gjson" --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f609b1c3..bedb357f4 100644 --- a/README.md +++ b/README.md @@ -482,7 +482,7 @@ But `ast.Visitor` is not a very handy API. You might need to write a lot of code Sonic use memory pool in many places like `encoder.Encode`, `ast.Node.MarshalJSON` to improve performace, which may produce more memory usage (in-use) when server's load is high. See [issue 614](https://github.com/bytedance/sonic/issues/614). Therefore, we introduce some options to let user control the behavior of memory pool. See [option](https://pkg.go.dev/github.com/bytedance/sonic@v1.11.9/option#pkg-variables) package. -### Faster JSON skip +### Faster JSON Skip For security, sonic use [FSM](native/skip_one.c) algorithm to validate JSON when decoding raw JSON or encoding `json.Marshaler`, which is much slower (1~10x) than [SIMD-searching-pair](native/skip_one_fast.c) algorithm. If user has many redundant JSON value and DO NOT NEED to strictly validate JSON correctness, you can enable below options: @@ -490,6 +490,11 @@ For security, sonic use [FSM](native/skip_one.c) algorithm to validate JSON whe - `Config.NoValidateJSONMarshaler`: avoid validating JSON when encoding `json.Marshaler` - `SearchOption.ValidateJSON`: indicates if validate located JSON value when `Get` +## JSON-Path Support (GJSON) + +[Gjson](https://github.com/tidwall/gjson) has provided a comprehensive and popular JSON-Path API, and + a lot of older codes heavily relies on it. Therefore, we provides a wrapper libary, which combines gjson's API with sonic's SIMD algorithm to boost up the performance. See [gjson](https://github.com/cloudwego/gjson). + ## Community Sonic is a subproject of [CloudWeGo](https://www.cloudwego.io/). We are committed to building a cloud native ecosystem.