Developing on Staxmanade

NuGet Project Uncovered: FastMember

If you are coming to this series of posts for the first time you might check out my introductory post for a little context.

FastMember would be something you pull in if you’re trying to do reflection to read properties of your objects, but starting to notice some performance issues. This project will emit some IL at runtime that can read your properties much faster than good old reflection (like below)

var value = typeof(MyObject).GetProperty(“MyProp”).GetValue(myObjInstance, new object[0]);

Replace the above with.

var accessor = TypeAccessor.Create(typeof(MyObject)); 
var value = accessor[obj, “MyProp”];



This project lets you either read or assign values to properties. (See my test below)



image_thumb1_thumb