Skip to content

AhmedTarekHasan/SealedKeyword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler-Friendly Code: Sealed Keyword in .NET C#

Why & When Sealed Keyword could lead to a performance boost in .NET C#.


What does it mean to write compiler friendly code?


Any .NET code passes by more than one phase till finally reaches the machine code. Since many factors are involved into this process, there could be lots of details which we miss when we are first writing our code.


However, the more clear and deterministic the code we write is, the more the compiler could assist us and generate optimized machine code.

In this article, we are going to discuss one example of the ways by which we can help the compiler optimize our code. This way is; using the Sealed Keyword.

Enough with the talking and let's see an example…


If you are interested into reading more about this topic, you can read the rest of the article.


If you want to support me:

▶ Subscribe to Medium using my referral link
▶ Subscribe to Medium Newsletter
▶ Subscribe to LinkedIn Newsletter
▶ Follow me on Medium
▶ Follow me on Twitter
▶ Follow me on LinkedIn


Authors: