镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Streamline DefaultChannelPool checkout and close paths - #2183

Merged
hyperxpro merged 2 commits into
mainfrom
perf/channelpool
Jun 7, 2026
Merged

hyperxpro merged 2 commits into
mainfrom
perf/channelpool

Conversation

@hyperxpro

Copy link
Copy Markdown
Member

Motivation:
DefaultChannelPool allocates a fresh IdleChannel holder on every keep-alive checkout and scans the partition deque O(n) to remove a channel on close.

Modification:
Store the bare Channel in the deque with idle state (timestamp + owned flag) on a reused per-channel attribute, and make removeAll an O(1) tombstone that the idle cleaner unlinks lazily.

Result:
Behavior-preserving; checkout drops 56 -to- 24 B/op and removeAll goes from O(n) to O(1) (depth-independent), per JMH on JDK 11.

@hyperxpro
hyperxpro merged commit 24339e5 into main Jun 7, 2026
28 of 30 checks passed
@hyperxpro
hyperxpro deleted the perf/channelpool branch June 7, 2026 13:05
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.

2 participants