Commit 664f203
authored
Optimise HttpMethod#valueOf fast path lookup. (#14982)
Motivation:
`HttpMethod#valueOf` has a fast path lookup for _GET_ and _POST_, those
call the `HttpMethod#name()` which calls `AsciiString#toString()` and
that is not necessary since we can cache the interned corresponding
strings locally like `HttpVersion#valueOf` does.
Changes:
Declare _GET_/_POST_ interned string constants and use them for fast
path lookup in `valueOf` method.
Result:
Avoid two un-necessaries method call on the fast path.1 parent a7e206d commit 664f203
1 file changed
Lines changed: 10 additions & 6 deletions
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
44 | | - | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | | - | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
110 | | - | |
111 | | - | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
113 | | - | |
114 | | - | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
0 commit comments