Skip to content

Avoid unused promise allocation in address resolution#2259

Open
pavel-ptashyts wants to merge 1 commit into
AsyncHttpClient:mainfrom
maygemdev:perf/resolve-addresses-promise
Open

Avoid unused promise allocation in address resolution#2259
pavel-ptashyts wants to merge 1 commit into
AsyncHttpClient:mainfrom
maygemdev:perf/resolve-addresses-promise

Conversation

@pavel-ptashyts

@pavel-ptashyts pavel-ptashyts commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move promise creation in NettyRequestSender.resolveAddresses into the explicit-address bypass branch.
  • Avoid allocating a completed promise on hostname and proxy resolution paths that return resolveHostname(...) instead.

Motivation

Most requests resolve by hostname and do not use the local Promise created at the start of resolveAddresses. Deferring the allocation keeps the explicit-address behavior unchanged while reducing per-request allocation on the common path.

Validation

  • ./mvnw -pl client -DskipTests compile
  • ./mvnw -pl client -Dtest=CustomRemoteAddressTest test

Attribution

Codex on behalf of Pavel Ptashyts

@pavel-ptashyts
pavel-ptashyts marked this pull request as ready for review July 19, 2026 15:50
Move promise creation in NettyRequestSender.resolveAddresses into the
explicit-address bypass path. Hostname and proxy resolution paths no
longer allocate a succeeded promise they do not use, while explicit
address requests keep the same completed Future behavior.

Codex on behalf of Pavel Ptashyts

Co-Authored-By: Codex <codex@openai.com>
@pavel-ptashyts
pavel-ptashyts force-pushed the perf/resolve-addresses-promise branch from d4b6d59 to bd64aab Compare July 20, 2026 08:50
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.

1 participant