You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/V4CanonicalRequest.java
+45-25Lines changed: 45 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,10 @@ public static List<Pair<String, List<String>>> getCanonicalHeaders(Map<String, L
181
181
* Each header-value pair is separated by a newline.
0 commit comments