perf(parser): scan the input as bytes instead of runes
Assisted-by: GLM 5.3
This commit is contained in:
@@ -42,6 +42,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
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.
|
||||
- The parser scans the input bytes in place instead of building a `[]rune`
|
||||
copy of the document: every character that drives the grammar is ASCII and
|
||||
the input is validated UTF-8 up front, so the conversion pass and its four
|
||||
bytes per rune were pure overhead. Parsing a large array-of-tables document
|
||||
runs about a fifth faster and allocates about half the memory.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user