Skip to content

Various performance improvements#3175

Merged
zoewangg merged 4 commits into
masterfrom
zoewang/variousPerfImprovements
May 2, 2022
Merged

Various performance improvements#3175
zoewangg merged 4 commits into
masterfrom
zoewang/variousPerfImprovements

Conversation

@zoewangg
Copy link
Copy Markdown
Contributor

Motivation and Context

Modifications

Various performance improvements

@zoewangg zoewangg requested a review from a team as a code owner April 28, 2022 21:38
Comment on lines +59 to +72
String placeholder = "not available";
String prefix = "Received " + (response.isSuccessful() ? "successful" : "failed") +
" response: ";
StringJoiner details = new StringJoiner(", ", prefix, "");
details.add("Status Code: " + response.statusCode());
String requestId = SdkHttpUtils.firstMatchingHeaderFromCollection(response.headers(),
X_AMZN_REQUEST_ID_HEADERS)
.orElse(placeholder);

details.add("Request ID: " + requestId);

response.firstMatchingHeader(X_AMZ_ID_2_HEADER).ifPresent(extendedRequestId ->
details.add("Extended Request ID: " + extendedRequestId));
return details.toString();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're worrying about efficiency, should we just use StringBuilder? This feels hard to read with StringJoiner.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, makes sense

Comment on lines +50 to +53
if (!VALUE_MAP.containsKey(normalizedValue)) {
throw new IllegalArgumentException("The provided value is not a valid algorithm " + value);
}
return VALUE_MAP.get(normalizedValue);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're being picky about performance, should we just do a get and check to see if the result is null? (I don't think we need null to be a valid algorithm)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, updated.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

85.2% 85.2% Coverage
0.0% 0.0% Duplication

@zoewangg zoewangg merged commit dfec4ab into master May 2, 2022
millems pushed a commit that referenced this pull request May 4, 2022
* Various performance improvements

* Address feedback and fix failed unit test

* Fix test
chibenwa added a commit to chibenwa/james-project that referenced this pull request May 13, 2022
S3 team had been, partly on our reports [1] working
on numerous performance enhancements [2] [3] that
Apache James IMAP workload would definitely benefit
from.

[1] aws/aws-sdk-java-v2#3162

[2] aws/aws-sdk-java-v2#3175

[3] aws/aws-sdk-java-v2#3178

Upgrade
@zoewangg zoewangg deleted the zoewang/variousPerfImprovements branch May 16, 2022 01:33
chibenwa added a commit to apache/james-project that referenced this pull request May 24, 2022
S3 team had been, partly on our reports [1] working
on numerous performance enhancements [2] [3] that
Apache James IMAP workload would definitely benefit
from.

[1] aws/aws-sdk-java-v2#3162

[2] aws/aws-sdk-java-v2#3175

[3] aws/aws-sdk-java-v2#3178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants