Closed AsterDY closed 4 months ago
Attention: Patch coverage is 58.84808%
with 493 lines
in your changes are missing coverage. Please review.
Project coverage is 76.63%. Comparing base (
3739ffe
) to head (bbf63a6
).
Files | Patch % | Lines |
---|---|---|
ast/raw.go | 64.67% | 194 Missing and 102 partials :warning: |
ast/decode.go | 0.00% | 52 Missing :warning: |
ast/parser.go | 66.01% | 43 Missing and 9 partials :warning: |
ast/search.go | 25.37% | 44 Missing and 6 partials :warning: |
ast/api_amd64.go | 57.44% | 16 Missing and 4 partials :warning: |
api.go | 14.28% | 18 Missing :warning: |
internal/rt/fastmem.go | 0.00% | 4 Missing :warning: |
ast/visitor.go | 50.00% | 1 Missing :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 also 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
!!!