Repository navigation
Avoid boxed redirect status lookup - #2260
Closed
pavel-ptashyts wants to merge 1 commit into
Closed
pavel-ptashyts wants to merge 1 commit into
pavel-ptashyts wants to merge 1 commit into
Conversation
Replace the redirect status Set lookup with a primitive status-code helper in the response interceptor hot path. This removes the Redirect30xInterceptor.REDIRECT_STATUSES set and avoids boxing response codes before redirect handling. Add a unit test for the exact redirect and non-redirect status codes covered by the helper. Verified with:\n- /opt/maven/bin/mvn -pl client -DskipTests compile\n- /opt/maven/bin/mvn -pl client -Dtest=Redirect30xInterceptorTest,Relative302Test test
Contributor
Author
|
Closing because this performance change will not be pursued. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Set<Integer>lookup with a primitive status-code helper.Redirect30xInterceptor.REDIRECT_STATUSES.Motivation
The response interceptor checks redirect status codes for every response. The previous
Set<Integer>lookup boxed each response status code before lookup. A primitive comparison helper keeps the redirect behavior unchanged while avoiding that allocation.Validation
/opt/maven/bin/mvn -pl client -DskipTests compile/opt/maven/bin/mvn -pl client -Dtest=Redirect30xInterceptorTest,Relative302Test test