-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-address client: optimize client selection (#2979)
Motivation: `selectClient` attracted my attention after I saw it can take up to 10% on the flame graph. Modifications: - Change `CachingKeyFactory` to `UrlKeyFactory`; - Remove an extra layer of caching for `UrlKey`s; - Eagerly compute `UrlKey.hashCode` because it's used >1 time; - Remove allocation of `HostAndPort` from the hot path because it's required only to create a new client once; Result: Client selection reduced from `63.788 ± 1.268 ns/op` to `14.512 ± 0.233 ns/op`.
- Loading branch information
1 parent
831346f
commit 7f8a7f4
Showing
1 changed file
with
27 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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