perf(decode): cache struct schemas per type

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-17 23:08:14 +02:00
parent a8d69d90d5
commit aaea68efc9
3 changed files with 29 additions and 3 deletions
+4
View File
@@ -38,6 +38,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
v2.2.0, run in TOML 1.0 mode. The new corpus holds 205 valid and 474 invalid
cases (v1.6.0 had 185 and 371), and it caught the two documents the parser
still accepted, fixed below.
- The flattened struct layout the decoder consults is cached per struct type
and shared with the encoder, which now resolves duplicate field keys with
it. Strict decoding of an array of tables of structs runs about a quarter
faster; marshalling structs gained the same layout without measurable cost.
### Fixed