Async streams
Generated on 10/5/2024
1 search
Async streams in Swift are implemented in a unique way to handle asynchronous operations efficiently. They keep their local state on a separate stack from the C stack and are split into multiple functions at runtime. This allows them to manage suspension points effectively. When an async function is called, it is divided into partial functions that span the gaps between potential suspension points. This ensures that only one partial function is on the C stack at any time, optimizing resource usage and performance.
For more details on how async functions are implemented, you can refer to the session Explore Swift performance (24:33).
Explore Swift performance
Discover how Swift balances abstraction and performance. Learn what elements of performance to consider and how the Swift optimizer affects them. Explore the different features of Swift and how they’re implemented to further understand the tradeoffs available that can impact performance.
A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.
Go further with Swift Testing
Learn how to write a sweet set of (test) suites using Swift Testing’s baked-in features. Discover how to take the building blocks further and use them to help expand tests to cover more scenarios, organize your tests across different suites, and optimize your tests to run in parallel.