I recently wrote up one of the harder performance problems I ran into while building a native macOS SSH client in SwiftUI: incoming SSH output can arrive much faster than a WebKit-backed terminal should render it.
The article focuses on:
- keeping SSH reads off the main actor
- batching bytes around a single UI flush point
- applying backpressure instead of letting queues grow without bound
- preserving the terminal’s lifetime across SwiftUI navigation
- measuring end-to-end latency, not just raw throughput
The implementation comes from Nexus Shell, a commercial app I develop. I am sharing this as engineering notes rather than a product announcement. I would be especially interested in how others model backpressure when a Swift producer feeds a web-backed renderer.
Disclosure: I used Codex to help edit the article, and verified the technical details against the implementation.