The Dangers of Equality in C# – Don't Make This Common Mistakes

Описание к видео The Dangers of Equality in C# – Don't Make This Common Mistakes

Euqality in C# seems very easy and straight forward. However, if we are not aware how different types of equality are enforced by #dotnet then we might run into some big performance troubles. In this video I get very deep into this concept by investigating reference and structural equality and how those apply to classes, structs and records. I also run some nice benchmark to showcase the equality caveats in #csharp.

Join this channel to get source code access and other perks:
   / @codewrinkles  

Contents
1. Intro: 00:00
2. Reference equality: 00:46
3. Structural equality: 07:12
4. "Weird" behavior with GetHashCode(): 08:11
5. Why property order matters: 13:54
6. Heavy performance traps: 15:18
7. Benchmark setup: 16:24
8. Really bad performance!!!! 19:47
9. Refactored, still bad performance: 22:17
10. What about records? 23:57
11. Examining lowered records: 25:37
12. Conclusions: 29:56

Комментарии

Информация по комментариям в разработке