Commit 5e47f2b
http2: avoid copying the options in respond()
respond() copied the user-provided options object on every call just
so it could normalize and locally flip options.endStream, and
prepareResponseHeadersObject() then looked the :status and date
fields up again on the dictionary-mode null-prototype headers copy
it had just built. Use a local variable for endStream and pick up
:status/date while copying the headers instead.
No measurable throughput change on its own; this removes an object
clone and several dictionary-mode property lookups per response.
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: #64265
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Tim Perry <pimterry@gmail.com>1 parent 351da9c commit 5e47f2b
1 file changed
Lines changed: 20 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2813 | 2813 | | |
2814 | 2814 | | |
2815 | 2815 | | |
| 2816 | + | |
| 2817 | + | |
2816 | 2818 | | |
2817 | 2819 | | |
2818 | 2820 | | |
| 2821 | + | |
| 2822 | + | |
2819 | 2823 | | |
2820 | 2824 | | |
2821 | | - | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
2822 | 2831 | | |
2823 | 2832 | | |
2824 | 2833 | | |
2825 | 2834 | | |
2826 | 2835 | | |
2827 | | - | |
2828 | | - | |
2829 | | - | |
| 2836 | + | |
2830 | 2837 | | |
2831 | | - | |
2832 | | - | |
| 2838 | + | |
| 2839 | + | |
2833 | 2840 | | |
2834 | 2841 | | |
2835 | 2842 | | |
2836 | 2843 | | |
2837 | | - | |
2838 | | - | |
2839 | | - | |
2840 | | - | |
| 2844 | + | |
2841 | 2845 | | |
2842 | 2846 | | |
2843 | 2847 | | |
| |||
3222 | 3226 | | |
3223 | 3227 | | |
3224 | 3228 | | |
3225 | | - | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
3226 | 3232 | | |
3227 | 3233 | | |
3228 | 3234 | | |
3229 | 3235 | | |
3230 | | - | |
| 3236 | + | |
3231 | 3237 | | |
3232 | 3238 | | |
3233 | | - | |
| 3239 | + | |
3234 | 3240 | | |
3235 | 3241 | | |
3236 | 3242 | | |
| |||
3253 | 3259 | | |
3254 | 3260 | | |
3255 | 3261 | | |
3256 | | - | |
| 3262 | + | |
3257 | 3263 | | |
3258 | 3264 | | |
3259 | 3265 | | |
3260 | 3266 | | |
3261 | | - | |
3262 | 3267 | | |
3263 | 3268 | | |
3264 | 3269 | | |
| |||
0 commit comments