This article is first part of the series of three. Next ones you can find here and here.
Code for all three articles, with new features and bug fixes is available on GitHub and as Nuget package.
Why not Reflection?
If you working with .NET and C# (probably other languages too), at some point, you will have to write more advanced and generic code, that i.e. reads all properties of a type, searches for attributes, etc. Or maybe you want to call some private method or property? It is not that rare to use some internal mechanism of framework or library. Usually, the first solution involves Reflection. But the thing is: Reflection is slow. Of course, it is sufficient if you need to use Reflection rarely and it is not the main code of the application. If it is used more often at some point, you will probably try to optimize it. And now is the fun part: how to do it? Continue reading “Faster than Reflection: Delegates. Part 1.”