Commit 63c601b
http: speed up checkIsHttpToken
The Regex implementation is not faster than ascii code compare.
the field name is shorter, the speed is faster.
benchmark result here:
https://bitbucket.org/snippets/JacksonTian/Rnbad/benchmark-result
PR-URL: #4790
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>1 parent 80155d3 commit 63c601bCopy full SHA for 63c601b
File tree
Expand file treeCollapse file tree
2 files changed
+100
-2
lines changedOpen diff view settings
Filter options
- benchmark/http
- lib
Expand file treeCollapse file tree
2 files changed
+100
-2
lines changedOpen diff view settings
Collapse file
benchmark/http/check_is_http_token.js
Copy file name to clipboard+52Lines changed: 52 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 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
Collapse file
+48-2Lines changed: 48 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
225 | 225 | |
226 | 226 | |
227 | 227 | |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
| 232 | + |
| 233 | + |
228 | 234 | |
229 | | - |
230 | 235 | |
231 | | - |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
232 | 278 | |
233 | 279 | |
234 | 280 | |
|
0 commit comments