Commit 1dba56e
committed
optimize string escaping by writing chunks instead of individual chars
The previous implementation wrote each character individually using write! macro,
which is inefficient for string formatting. The new implementation uses write_str
to write larger chunks of the string at once, significantly reducing the number
of write operations and formatting overhead.
This change maintains the same escaping behavior but improves performance by
avoiding character-by-character writes.1 parent 052ad4a commit 1dba56e
1 file changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
460 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
464 | | - | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
474 | 478 | | |
475 | 479 | | |
476 | 480 | | |
477 | | - | |
478 | 481 | | |
479 | 482 | | |
480 | 483 | | |
481 | 484 | | |
482 | 485 | | |
| 486 | + | |
483 | 487 | | |
484 | 488 | | |
485 | 489 | | |
| |||
0 commit comments