Commit af61c79
committed
http: move invariant IncomingMessage defaults to the prototype
Fields the parser (or the client/server glue) assigns before user code
can observe the message (httpVersion*, url, method, statusCode,
statusMessage, upgrade) become prototype defaults instead of nine
per-request own-property stores.
Note: for messages that never get these fields assigned (bare
IncomingMessage construction outside the parser path), they disappear
from Object.keys()/spread results, though property reads are unchanged.
Kept as a separate commit so it can be dropped independently if that
tradeoff is unwanted.
Together with the previous commit this measures +8.46% requests per
CPU-second (p=2.2e-11, 15x600k-request interleaved samples) over the
pre-series baseline.
Assisted-by: Grok
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>1 parent 43a9d71 commit af61c79
1 file changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 68 | | |
72 | 69 | | |
73 | 70 | | |
| |||
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 78 | | |
91 | 79 | | |
92 | 80 | | |
| |||
98 | 86 | | |
99 | 87 | | |
100 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
0 commit comments