Archive for July, 2009
I udpated the SortableCollection code at http://sortablecollection.codeplex.com.
The sorting operation has taken out all of the Reflection invocation and replaced it with DynamicMethod creations. DynamicMethod is used to cause direct IL emitting of things like MethodBody from a reflection call. You can then create a delegate out of the DynamicMethod to make a call to a compiled method. This implementation has proved to execute much much faster since it is technically invocating a compiled method versus making a pure reflection invocation. The new performance metric is as follows:
150,000 items sorted on 2 columns in 400-600 milliseconds.
As you can see the performance has improved drastically over the reflection calls. If any of you are looking at doing heavy reflection and are leaning against it because of the known performance issues I would definatly look into DynamicMethod and direct IL emitting.
For a great example you can check out the DynamicMethodHandle component of the CSLA framework at http://www.lhotka.net/ . This code is owned and Copyright 2009 Marimer LLC. So make sure to take note of the license agreement if you decide to use it.
And as always happy coding!
Last wednesday July 1st I received the MVP Award from Microsoft in Client App Dev! I am very happy and excited about this achievement and thank everyone who supported me in this. Its been a wild ride building up my community involvement to this level. I look forward to writing and presenting many more times and sharing my knowledge of .NET.
If you would like to check out my profile you can see it here!
Thanks again everyone and I hope to provide more content soon!