docs(architecture): scope the no-caching claim to the parser
Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -99,8 +99,8 @@ sequenceDiagram
|
|||||||
`Decode`, `DecodeContext`, `Marshal` and `MarshalContext` call allocates its
|
`Decode`, `DecodeContext`, `Marshal` and `MarshalContext` call allocates its
|
||||||
own unexported worker, so a configured type is safe for concurrent use; the
|
own unexported worker, so a configured type is safe for concurrent use; the
|
||||||
setter methods are not, and must finish before the value is shared.
|
setter methods are not, and must finish before the value is shared.
|
||||||
- The parser is allocated per `ParseContext` call; nothing is cached between
|
- The parser is allocated per `ParseContext` call; the parser itself caches
|
||||||
documents.
|
nothing between documents.
|
||||||
- The one piece of shared state is the struct-schema cache in `decode.go`: a
|
- The one piece of shared state is the struct-schema cache in `decode.go`: a
|
||||||
`sync.Map` keyed by `reflect.Type`, holding the flattened field layout the
|
`sync.Map` keyed by `reflect.Type`, holding the flattened field layout the
|
||||||
decoder and the encoder both consult. A schema is immutable once published,
|
decoder and the encoder both consult. A schema is immutable once published,
|
||||||
|
|||||||
Reference in New Issue
Block a user