Closed AsterDY closed 8 months ago
Attention: 575 lines
in your changes are missing coverage. Please review.
Comparison is base (
63f4c07
) 78.57% compared to head (583741e
) 77.60%.
Files | Patch % | Lines |
---|---|---|
ast/raw.go | 65.05% | 186 Missing and 103 partials :warning: |
ast/parser.go | 63.78% | 93 Missing and 62 partials :warning: |
ast/search.go | 33.33% | 45 Missing and 9 partials :warning: |
ast/decode.go | 0.00% | 52 Missing :warning: |
api.go | 5.26% | 18 Missing :warning: |
ast/api_amd64.go | 78.12% | 4 Missing and 3 partials :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Background
sonic/ast.Node
provide completed and efficient APIs to manipulate JSON. However, due to itstransversely-lazy-load
design, it CANNOT be read concurrently, result in limited usage in practice -- or abuse usage ofLoadAll()
. Therefore, we consider introduce a new typeast.Value
, whose APIs are all based on JSONskipping-and-searching
algorithm, can naturally support concurrently readThread Safty
GetXX()
: All read APIs are implemented bysearching-and-skipping
raw JSON, and returned a slice of the origin -- Thus it is thread-safeSetXX()
: All write APIs are implemented based onGetXX()
, and returned a new copy to the origin -- Thus it is false thread-safe, while the correctness of currently-writing need user to ensure by itselfPerformance
Value
's performance is close toNode
, and 3x~10x times faster than the same API ofgjson
|sjson
!!!