Last post Oct 20, 2014 12:39 AM by demoninside9
Sep 03, 2014 11:30 PM|sun21170|LINK
Is it a good idea to use sealed classes, and is there any benefit like performance associated with sealed classes as compared to normal class?
I know that a sealed class cannot be inherited, but why should I use it instead of a normal class?
Sep 04, 2014 01:47 AM|Mikesdotnetting|LINK
Sep 05, 2014 04:19 AM|Jamobor yao - MSFT|LINK
Using sealed keyword brings not only performance win and additional code access security but also helps to write bug free code, making better use of the .NET type safety, see more at:
Sep 05, 2014 05:18 AM|Mikesdotnetting|LINK
Jamobor yao - MSFT
Using sealed keyword brings not only performance win
The article you referenced doesn't specify what kind of performance "win" there is to be had and only refers vaguely to something half-remembered by the author. One should be careful when quoting selectively from articles like that. The article completely
fails to demonstrate that there is a performance gain of any significance.
Sep 05, 2014 11:28 AM|sun21170|LINK
I did some research and found a mention about performance gain with sealed classes, but its not explained in detail. I came across this on MSDN at
The documentation given in above URL said the following about sealed classes.
"A sealed class cannot be used as a base class. For this reason, it cannot also be an abstract class. Sealed classes prevent derivation.
Because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster."
Oct 20, 2014 12:39 AM|demoninside9|LINK
you should read this also