April 2006 Entries

Generic IComparer is a good thing. And null comparisons

There is something I've been wanting to post about for a while, but just didn’t have enough info to make it worth my, or anyone who reads this, while. We all know that .Net 2.0 came out with something wonderful called Generics. I've been profiling a lot of my 1.1 code, comparing it to my 2.0 code that utilizes Generics, and the one change that has given me the greatest, most dramatic performance benefits is to switch from IComparer to IComparer. I use IComparer a LOT. But there is a problem...