Commit feec1db
perf: inline \u hex parsing and span-based number parsing in JSON parser
- \uXXXX escapes now index directly into the source string instead of
calling Substring(i+2, 4), saving one string allocation per unicode
escape encountered while parsing JSON strings.
- \U case: replace s.[0..1] slice comparison (which allocates a string)
with direct char comparisons s.[0] <> '0' || s.[1] <> '0'.
- parseNum: on net8.0, use Decimal.TryParse(span) / Double.TryParse(span)
instead of Substring to avoid one string allocation per number token.
The netstandard2.0 path is unchanged (span overloads not available).
Bumps version to 8.1.8.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent dac71d4 commit feec1db
2 files changed
Lines changed: 24 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 358 | + | |
| 359 | + | |
362 | 360 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
367 | 365 | | |
368 | 366 | | |
369 | | - | |
370 | 367 | | |
371 | 368 | | |
372 | 369 | | |
| |||
376 | 373 | | |
377 | 374 | | |
378 | 375 | | |
379 | | - | |
| 376 | + | |
380 | 377 | | |
381 | 378 | | |
382 | 379 | | |
| |||
408 | 405 | | |
409 | 406 | | |
410 | 407 | | |
| 408 | + | |
411 | 409 | | |
412 | 410 | | |
413 | 411 | | |
| |||
416 | 414 | | |
417 | 415 | | |
418 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
419 | 428 | | |
420 | 429 | | |
421 | 430 | | |
| |||
0 commit comments