Commit 2a462ba
http: optimize checkInvalidHeaderChar()
This commit optimizes checkInvalidHeaderChar() by unrolling the
character checking loop a bit.
Additionally, some changes to the benchmark runner are needed in
order for the included benchmark to be run correctly. Specifically,
the regexp used to parse `key=value` parameters contained a greedy
quantifier that was causing the `key` to match part of the `value`
if `value` contained an equals sign.
PR-URL: #6570
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>1 parent 4a63be0 commit 2a462baCopy full SHA for 2a462ba
File tree
Expand file treeCollapse file tree
3 files changed
+69
-10
lines changedOpen diff view settings
Filter options
- benchmark
- http
- lib
Expand file treeCollapse file tree
3 files changed
+69
-10
lines changedOpen diff view settings
Collapse file
+3-5Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
191 | 191 | |
192 | 192 | |
193 | 193 | |
194 | | - |
| 194 | + |
195 | 195 | |
196 | 196 | |
197 | 197 | |
| ||
238 | 238 | |
239 | 239 | |
240 | 240 | |
241 | | - |
242 | | - |
243 | 241 | |
244 | 242 | |
245 | 243 | |
246 | 244 | |
247 | 245 | |
248 | 246 | |
249 | 247 | |
250 | | - |
| 248 | + |
251 | 249 | |
252 | 250 | |
253 | 251 | |
254 | | - |
| 252 | + |
255 | 253 | |
256 | 254 | |
257 | 255 | |
|
Collapse file
benchmark/http/check_invalid_header_char.js
Copy file name to clipboard+42Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
Collapse file
+24-5Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
301 | 301 | |
302 | 302 | |
303 | 303 | |
| 304 | + |
| 305 | + |
| 306 | + |
| 307 | + |
304 | 308 | |
305 | 309 | |
306 | | - |
307 | | - |
308 | | - |
309 | | - |
310 | | - |
| 310 | + |
| 311 | + |
| 312 | + |
| 313 | + |
| 314 | + |
| 315 | + |
| 316 | + |
| 317 | + |
| 318 | + |
| 319 | + |
| 320 | + |
| 321 | + |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
| 328 | + |
| 329 | + |
311 | 330 | |
312 | 331 | |
313 | 332 | |
|
0 commit comments