Wednesday 

Room 2 

16:20 - 17:20 

(UTC+01

Talk (60 min)

Writing (in)efficient C#

Surprisingly there are many small things we C# developers do that lead to inefficient code.

.NET
Testing
Tools

All of this can add up to a big performance or stability problem, especially at scale... With an understanding of what happens under-the-hood, and the tools available to help, this doesn't have to be the case!

This session will dive deep into common C# pitfalls and how to avoid them, covering: enumeration, deferred execution, casting and boxing, string concatenation, statics and object disposal, and reducing allocations. We'll explore how methods like ToList() and ToArray() to work internally, and how they are often misused alongside the convenience of features like Linq to create serious inefficiencies.

Importantly, let's learn how to diagnose and fix performance issues when they do occur – with the help of some widely available tools to help identify inefficient code; directly within Visual Studio, with external tools like DotTrace or ANTS Profiler, with Open Source tools like BenchmarkDotNet, and even cloud tools like Application Insights.

Finally we will discuss how to adapt processes to help prevent issues in the first place, measuring and tracking performance improvements as part of development cycles, and convincing teams to treat performance with equal importance as features.

Everyone will leave with knowledge of how to optimise their code in a meaningful way!

Callum Whyte

Callum Whyte is a x4 Microsoft MVP and x6 Umbraco MVP specialising in building robust scalable solutions on Azure and the .NET stack, as well as websites with the open-source Umbraco CMS.

Away from his desk you can find him organising community events; from local meetups and hackathons, to global conferences and roadshows. He’s an active contributor to open source projects, a regular speaker at events all over the world, as well as co-host of a weekly YouTube series “UmbraCoffee”!