[Perf improvement]ReduceGatewayModePerRequestCPUOverhead#48430
Closed
xinlian12 wants to merge 2 commits intoAzure:mainfrom
Closed
[Perf improvement]ReduceGatewayModePerRequestCPUOverhead#48430xinlian12 wants to merge 2 commits intoAzure:mainfrom
xinlian12 wants to merge 2 commits intoAzure:mainfrom
Conversation
xinlian12
commented
Mar 16, 2026
...mos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentServiceRequest.java
Show resolved
Hide resolved
xinlian12
commented
Mar 16, 2026
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
69ecd40 to
83f06ec
Compare
xinlian12
commented
Mar 16, 2026
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
a277bf4 to
9476987
Compare
xinlian12
commented
Mar 16, 2026
...smos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/ReactorNettyClient.java
Show resolved
Hide resolved
9476987 to
6b181bc
Compare
v4 approach: getUri() returns String directly. The downstream flow passes the string through without constructing java.net.URI again. HttpRequest stores the URI string natively; uri() lazily parses only when needed (error paths). getUri() uses the standard URI constructor for correct percent-encoding of unicode resource names, then calls toASCIIString() once. The URI object is not retained — only the string flows downstream. ReactorNettyClient uses request.uriString() instead of uri().toASCIIString(), avoiding a redundant conversion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6b181bc to
939a8d9
Compare
xinlian12
commented
Mar 17, 2026
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
Replace the URI-based wrapInHttpRequest(request, URI) signature in HttpTransportSerializer with wrapInHttpRequest(request, String, int) so all serializers use strings directly and avoid URI parsing overhead. Both RxGatewayStoreModel and ThinClientStoreModel now implement the string-based method, eliminating the if/else branching in performRequestInternalCore and the fallback new URI(requestUri) allocation for thin client requests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
the major improvements comes from eliminating URI construction (just use StringBuilder), consistent 4-10% improvement on throughput, but using StringBuilder miss some edge cases, so for now, will not adopt the eliminating URI changes. |
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.
No description provided.