Last Updated: February 25, 2016
·
1.481K
· marcel-valdez

FasterFlect - Fast & Easy .Net Reflection

I don't know how many people use Reflection on .Net, nor how many of us who use Reflection on .net know FasterFlect.

But I'll tell you off the bat, FasterFlect is the fastest reflection library out there, faster than .Net's own dynamic implementation.

With that told, FasterFlect is also very easy to use, here is an example:

object toReflect = new List<int>();
toReflect.Call("Add", 1);
var method = toReflect.GetDelegateForCallMethod("Add", typeof(int));
method(2);

List<int> realList = (List<int>)toReflect;
System.Console.WriteLine(realList[0]); // Prints: 1
System.Console.WriteLine(realList[1]); // Prints: 2