We're using compiled Expression Trees to generate code dynamically; some information only available to us at runtime enables us to (in theory) write simpler, faster code.
We do get a performance boost in many cases.
However, in some cases we get a performance hit. In such cases, the Visual Studio Profiler shows that the difference in performance is due to this method (which doesn't show up at all in statically compiled code)
JIT_MethodAccessCheck
What does this method do? (Google doesn't have much to say about it).
Can I optimize it away somehow?
JIT_MethodAccessCheck
method performs security checks such as SecurityTransparent, APTCA and class access checks as mentioned by @xanatos.
Class access checks include SecurityCritical, SecuritySafeCritical, attached profiler bypass and LinkDemand. More details can be found at coreclr jithelpers.cpp.
Since coreclr is compatible with CLR, we can safely assume that the checks are in the same manner in both of them.
Use the code snippet in this answer to compile expression trees instead, it gets rid of the checks across method boundaries:
Why is JIT_MethodAccessAllowedBySecurity taking so much time?