Files
Cameron Robey a46134557b Fix copy on write behaviour in QuiescingHelper (#298)
Fix a copy on write issue in QuiescingHelper that led to significant
performance problems when the number of channels became large, or
connection churn.

### Motivation:

When using QuiescingHelper, every channel holds onto a reference to
ChannelCollector, which leads to copy on write behaviour for
`openChannels[]`. This has performance issues when a large number of
channels are open (e.g. 25k channels can be hundreds of KB), and every
time a channel is opened, or closed this is copied. As accepting
channels happens on a single NIO thread, this work is all done on that
thread, and can lead to saturation, and no more channels being accepted.

### Modifications:

Move the state into a non copyable LifecycleStateMachine, to avoid the
copies.

### Result:

Overhead from ChannelCollector disappears (as seen in traces from
http://github.com/apple/swift-profile-recorder).
2025-12-04 11:06:22 +00:00
..