# .NET Just in Time Compilation and Warming up Your System

DevFeed: [.NET Just in Time Compilation and Warming up Your System](<https://devfeed.tech/articles/net-just-in-time-compilation-and-warming-up-your-system-20707.md>)

Original publisher: [Read original article](<https://docs.microsoft.com/archive/blogs/abhinaba/net-just-in-time-compilation-and-warming-up-your-system>)

Author: Abhinaba Basu \[MSFT\]

Published: 2014-09-29T12:23:49Z

Content type: article

Language: en

Sources: [Abhinaba Basu](<https://devfeed.tech/sources/abhinaba-basu.md>)

Topics: [JIT](<https://devfeed.tech/topics/jit.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [application](<https://devfeed.tech/tags/application.md>), [assembly](<https://devfeed.tech/tags/assembly.md>), [bottlenecks](<https://devfeed.tech/tags/bottlenecks.md>), [breakpoint](<https://devfeed.tech/tags/breakpoint.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [csc](<https://devfeed.tech/tags/csc.md>), [debug](<https://devfeed.tech/tags/debug.md>), [debugger](<https://devfeed.tech/tags/debugger.md>), [deploy](<https://devfeed.tech/tags/deploy.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception](<https://devfeed.tech/tags/exception.md>), [execution](<https://devfeed.tech/tags/execution.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [jit](<https://devfeed.tech/tags/jit.md>), [net](<https://devfeed.tech/tags/net.md>), [scaling](<https://devfeed.tech/tags/scaling.md>)

## AI overview

The .NET CLR JIT compiles methods on first execution, at method granularity: in the example, `a()` is compiled before `b()`, and calling `b()` reaches a fixup thunk that triggers JIT compilation on the same thread. The CLR then patches the thunk to jump to `b()`'s native code. Because only executed branches trigger downstream methods, warming one path may leave other branch targets uncompiled. For startup latency, the article describes NGEN, multicore or forced JIT, and warmer queries; it also recommends moving rarely used error handling into separate methods. Its sample `RuntimeHelpers.PrepareMethod` approach can force compilation across selected assemblies and be parallelized, but lacks error handling. The guidance is based on the described example and notes caveats such as inlining.

## Source excerpt

One of the primary obstacle we face while scaling our system is Just In Time (JIT) compilation of...