Commit 7438ab9
perf(context): add fast path to c.json() matching c.text() optimization (#4707)
* perf: add fast path to c.json() matching c.text() optimization
Skip #newResponse() and Headers allocation when no status, headers,
or finalized state exists. Creates Response directly with inline
Content-Type header, matching the existing c.text() fast path pattern.
* ci: apply automated fixes
* use `Response.json()`
* don't use `any`
* refactor with `useFastPath`
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>1 parent 034223f commit 7438ab9
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
660 | 664 | | |
661 | 665 | | |
662 | 666 | | |
| |||
674 | 678 | | |
675 | 679 | | |
676 | 680 | | |
677 | | - | |
| 681 | + | |
678 | 682 | | |
679 | 683 | | |
680 | 684 | | |
| |||
703 | 707 | | |
704 | 708 | | |
705 | 709 | | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
711 | 719 | | |
712 | 720 | | |
713 | 721 | | |
| |||
0 commit comments