Commit Graph
14 Commits
Author SHA1 Message Date
petrbalvin 9874464213 perf(decode): resolve interfaces through cached type flags
The decoder asked every value whether it implements Unmarshaler or encoding.TextUnmarshaler by boxing it into an interface and asserting, which allocated on every scalar field. A per-type flag cache answers first and an interface value is built only where the assertion can succeed; interface destinations are still asked dynamically. A monomorphic hint in front of the cache keeps the hot walk off the sync.Map probe, and it re-points at published cache entries so a miss allocates nothing.

Representative document: 233 to 167 allocations; long document typed decode: 107 674 to 63 772 allocations, about 6.1 to about 3.8 ms.
2026-09-20 22:15:23 +02:00
petrbalvin a6e3e3fe31 feat: add OffsetDateTime, nesting limits and uniform Marshaler dispatch
Test / test (push) Successful in 2m18s
Assisted-by: DeepSeek V4.1 Flash
2026-09-19 19:36:24 +02:00
petrbalvin 815141440e feat: honour TextMarshaler and TextUnmarshaler by default
Test / test (push) Successful in 1m35s
Assisted-by: DeepSeek V4.1 Flash
2026-09-19 02:41:09 +02:00
petrbalvin 9023784da3 fix(decode): decode into a defined string or bool type
Assisted-by: DeepSeek V4.1 Flash
2026-09-19 02:40:51 +02:00
petrbalvin 3c8ac859c0 fix(decode): report the smallest unknown field deterministically
Assisted-by: GLM 5.3
2026-09-17 23:11:38 +02:00
petrbalvin c485aab227 fix(decode): overflow-check uint and float32 destinations
Assisted-by: GLM 5.3
2026-09-17 23:10:24 +02:00
petrbalvin 30b28fe7fc fix(encode): emit one key when two fields resolve to one name
Assisted-by: GLM 5.3
2026-09-17 23:08:42 +02:00
petrbalvin aaea68efc9 perf(decode): cache struct schemas per type
Assisted-by: GLM 5.3
2026-09-17 23:08:14 +02:00
petrbalvin a8d69d90d5 fix(decode): terminate the schema walk on a self-embedded pointer struct
Assisted-by: GLM 5.3
2026-09-17 23:07:53 +02:00
petrbalvin bb238c98c3 fix(decode): let the later field win an equal-depth name clash
Assisted-by: GLM 5.3
2026-09-17 23:07:27 +02:00
petrbalvin 3f41266710 feat: typed decode and encode errors with the key path
Assisted-by: GLM 5.3 Flash
2026-09-17 21:20:47 +02:00
petrbalvin fc50e3c49a fix: decode untagged embedded structs and maps inline
Test / test (push) Successful in 1m26s
Assisted-by: GLM 5.3 Flash
2026-09-17 20:05:50 +02:00
petrbalvin 93c36cf376 feat: honour the omitzero and omitempty tag options on encode
Assisted-by: GLM 5.3 Flash
2026-09-17 19:57:23 +02:00
petrbalvin c4ed84282c feat: TOML 1.0 parser and encoder
Assisted-by: GLM 5.3 Flash
2026-08-19 09:47:00 +02:00