In order to precompile method without invoking it you should use System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod method.
Possible situation when this method is extremely necessary: You need to precompile huge assembly in separate thread during application delays and you can't use ngen.exe.
User always complain about lazy load of all screens in .NET applications. This lazy load is caused by JIT compilation...
For instance, you have fat (rich) client application with log-in screen. During log-in process you can pre-compile heavy assemblies in separate thread.
Subscribe to:
Post Comments (Atom)
1 comment:
A more realistic scenario is what the runtime does when you derive from CriticalFinalizerObject, or when you're in a constrained region.
Post a Comment