docs(architecture): scope the no-caching claim to the parser

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-18 00:20:31 +02:00
parent 81033bb27c
commit 6a043e2824
+2 -2
View File
@@ -99,8 +99,8 @@ sequenceDiagram
`Decode`, `DecodeContext`, `Marshal` and `MarshalContext` call allocates its
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.
- The parser is allocated per `ParseContext` call; nothing is cached between
documents.
- The parser is allocated per `ParseContext` call; the parser itself caches
nothing between documents.
- 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
decoder and the encoder both consult. A schema is immutable once published,