No Virtual Members on Generic Collections [Ryan Byington]

A customer asked me why we decided to make the members on our generic collection non virtual when every member on the non generic collections was virtual. I though other might be interested in this so I decided to answer it here.

When we shipped the first version of the .NET Framework we wanted to make the collections as flexible as possible by making every method and property on the collections virtual. Allowing users to inherit from our collection and provide new functionality by overriding these members. However this comes at a price since virtual methods are slower then non-virtual methods and virtual methods can not be inlined.

 We received a lot of feedback that the performance of our collections was poor. So in V2.0 when designing the generic collections we decided to make the trade off of speed over flexibility and made the call to make all methods non-virtual.