perf(number): skip the rebuild for tokens without underscores

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-17 23:12:00 +02:00
parent f1a757ec5c
commit 53102d70e6
2 changed files with 37 additions and 9 deletions
+4
View File
@@ -47,6 +47,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
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.
- Numeric tokens without underscores skip the normalising rebuild: digits are
validated in place in `joinDigits`, and a float whose token is already
clean goes to `strconv.ParseFloat` directly. One allocation per integer
atom and two per float atom disappear.
### Fixed