Commit 0ab7f75
authored
Performance improvement for sigv4 signing. (#4867)
1. When trimming and removing consecutive spaces during sigv4 normalization, copy word-by-word instead of character-by-character. This reduces the overhead of range and encoding checks in string builder.
2. Increase starting string builder size for canonical headers, to limit resizing (2048 worked well for DynamoDB's get-item).
3. Use a switch statement for whitespace checks instead of consecutive if statements. On my compiler, the switch statement compiles to a jump table which runs quicker.1 parent 093501d commit 0ab7f75
File tree
1 file changed
+45
-25
lines changed- core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer
1 file changed
+45
-25
lines changedLines changed: 45 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| |||
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
265 | 260 | | |
266 | 261 | | |
267 | 262 | | |
268 | | - | |
269 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
270 | 283 | | |
271 | 284 | | |
272 | | - | |
273 | | - | |
274 | | - | |
| 285 | + | |
| 286 | + | |
275 | 287 | | |
276 | | - | |
277 | | - | |
278 | 288 | | |
279 | 289 | | |
280 | 290 | | |
| |||
365 | 375 | | |
366 | 376 | | |
367 | 377 | | |
368 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
369 | 389 | | |
370 | 390 | | |
371 | 391 | | |
| |||
0 commit comments