BrunoJuchli / StaticProxy.Fody

Creating proxies at compile time.
16 stars 3 forks source link

Performance Improvement - Move Reflection calls to static initializer #15

Open BrunoJuchli opened 7 years ago

BrunoJuchli commented 7 years ago

StaticProxy.Fody:

For generated classes and proxied-classes, all reflection calls should be moved to a static intializer and henceforth referenced in the called methods.

Otherwise each method call also induces one or multiple reflection calls.

If a *static constructor" is used for this task, this also requires removing "beforefieldinit" from class' attributes. See: http://csharpindepth.com/Articles/General/Beforefieldinit.aspx