Switch is Faster than If (in C#)
May 24, 20225 min readSwitch statements are faster because the switch statement is optimized before getting compiled. When there are enough cases, a tree-structure is built
Blog posts based on various engineering, development and IT topics. Most of the time focused on software engineering - with background information and practical tips from real projects. Many of them are published on my dev.to page, too.
Switch statements are faster because the switch statement is optimized before getting compiled. When there are enough cases, a tree-structure is built
A Mechanism to make a time-scoped registration which is just bound to a timeframe
Using String.ToLower() to compare strings with different casing can impact the performance of your C# apps
An introduction to Task.WhenAll() for C# Task Asynchronous Programming and how to use it properly in your applications to boost performance and reduce latency
How does Dependency Injection work, why developers apply it and how to implement a basic version yourself
Strategy design pattern implemented in C# using a classic way and with dependency injection - comparing both solutions
The ultimate guide for running your .NET 5.0 WebApi inside a Docker container.
Some thoughts about progress indicators in console application. I've added implementation details for Go and C# using several approaches.