Commit 397d3e7
okhttp: Optimize HPACK to index :path
Allow the :path pseudo-header to be added to the HPACK dynamic table in
the gRPC-Java OkHttp transport.
In gRPC, the :path header typically represents the service and method name
(e.g., /package.Service/Method), which is constant across multiple calls to
the same method. The previous HPACK implementation, inherited from OkHttp,
did not index :path, treating it as potentially highly variable.
By allowing :path to be indexed, subsequent gRPC calls to the same method
can benefit from HPACK's dynamic table, reducing header size.1 parent f021bef commit 397d3e7
2 files changed
Lines changed: 35 additions & 11 deletions
File tree
- okhttp/third_party/okhttp
- main/java/io/grpc/okhttp/internal/framed
- test/java/io/grpc/okhttp/internal/framed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
495 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
496 | 501 | | |
497 | 502 | | |
498 | 503 | | |
| |||
Lines changed: 27 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | | - | |
| 281 | + | |
278 | 282 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
1104 | 1108 | | |
1105 | 1109 | | |
1106 | 1110 | | |
1107 | | - | |
| 1111 | + | |
| 1112 | + | |
1108 | 1113 | | |
1109 | 1114 | | |
1110 | 1115 | | |
1111 | 1116 | | |
| 1117 | + | |
1112 | 1118 | | |
1113 | | - | |
1114 | | - | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1115 | 1134 | | |
1116 | 1135 | | |
1117 | 1136 | | |
| |||
0 commit comments