This presentation examines different approaches to asynchronous processing in .NET, using a web scraping application as a case study. It explores the nuances of concurrency models such as BlockingCollection, System.Threading.Channels, TPL Dataflow, and task continuation trees, comparing them to a naïve async approach. Each model's implementation is illustrated with code examples, highlighting their strengths and weaknesses in terms of throughput, latency, resource utilization, and developer effort. The presentation emphasizes the importance of choosing the right concurrency model for a given task and leveraging established libraries for optimal performance and maintainability. It also encourages thorough testing and benchmarking to validate the chosen approach.
The accompanying GitHub repository (https://github.com/tamirdresher/AsyncProcessingInDotNet-Webscraper) provides the full source code for the web scraping application and includes benchmarking results for each concurrency model, allowing for a deeper understanding of their real-world performance characteristics.