Why would the .NET JIT compiler decide to not inline or optimize away calls to empty static methods that have no side effects?
问题 I think I'm observing the .NET JIT compiler not inlining or optimizing away calls to empty static methods that have no side effects, which is a bit surprising given some bespoken online resources. My environment is Visual Studio 2013 on x64, Windows 8.1, .NET Framework 4.5. Given this simple test program (https://ideone.com/2BRCpC) class Program { static void EmptyBody() { } static void Main() { EmptyBody(); } } A release build with optimizations of the above program produces the following