title: Avoiding C# JIT overhead
body: <p>Is there an easy way of JIT-ing C# code up front, rather than waiting for the first time the code is invoked?  I have read about NGEN but I don't think that's going to help me.  </p>
  
  <p>My application waits and responds to a specific external event that comes from a UDP port, and  none of the critical-path code is (a) run before the event arrives, or (b) ever run again, so the cost of JIT is high in this scenario.  Checking with ANTS profiler the overhead for JIT is around 40-50%, sometimes it's as high as 90%.  My application is highly latency sensitive, and every millisecond counts.</p>
  
  <p>My initial thought is that I could add a bool parameter to every critical path method, and call those methods before the event occurs, in order to initiate the JIT compile.  However, is there a prettier and less hacky way?</p>
  
  <p>Many thanks</p>