Skip to content

#1951 refactor: replace linear proxy scan with lookup map in MultiProxyManager#1953

Closed
leedongkyu0407 wants to merge 1 commit into
apache:mainfrom
leedongkyu0407:fix/multiproxy-lookup-map
Closed

#1951 refactor: replace linear proxy scan with lookup map in MultiProxyManager#1953
leedongkyu0407 wants to merge 1 commit into
apache:mainfrom
leedongkyu0407:fix/multiproxy-lookup-map

Conversation

@leedongkyu0407

Copy link
Copy Markdown

Closes #1951

Summary

Replace the O(n) linear scan in getConfiguredProxy() with an O(1) map lookup.

Changes

  • Added proxyLookupMap field (HashMap keyed on normalized proxy identity)
  • Built the map in both configure() overloads after proxies are loaded
  • Added proxyKey() helper that normalizes protocol and address to lowercase, consistent with ProxyUtils.isSameProxy()
  • Replaced the for-loop in getConfiguredProxy() with a map lookup

Notes

  • No behavior change
  • Key includes credentials to match ProxyUtils.isSameProxy() semantics
  • MultiProxyManagerTest: 13/13 passed
  • ProtocolTest.testBlocking failure is pre-existing and unrelated to this change

@leedongkyu0407 leedongkyu0407 deleted the fix/multiproxy-lookup-map branch June 16, 2026 09:19
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.

[Improvement] Replace linear proxy scan in MultiProxyManager with a lookup map

1 participant