Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the advantages and disadvantages of pre-jitting assemblies in .NET?

Tags:

c#

.net

jit

What are the advantages and disadvantages of pre-jitting assemblies in .NET?

I heard that pre-jitting will improve performance. When should I pre-jit and when shouldn't I pre-jit?

like image 256
funwithcoding Avatar asked Jan 28 '11 15:01

funwithcoding


People also ask

Why would pre JIT be used by the .NET framework?

"Pre-jitting" or pre-compiling will improve performance, at start up, because you would be skipping that step. The reason that . NET JITs every time an app and its libraries load is so that it can run on many platforms and architectures with the best possible optimizations without the need for managing your builds.

What are CLR and JIT in VB net?

The JIT compiler is part of the Common Language Runtime (CLR). The CLR manages the execution of all . NET applications. In addition to JIT compilation at runtime, the CLR is also responsible for garbage collection, type safety and for exception handling.

What is assemblies explain why assemblies are used in .NET framework?

An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (. dll) files, and are the building blocks of . NET applications.

What is the role of JIT compiler in .NET framework?

Compiling translates your source code into Microsoft intermediate language (MSIL) and generates the required metadata. Compiling MSIL to native code. At execution time, a just-in-time (JIT) compiler translates the MSIL into native code.


1 Answers

"Pre-jitting" or pre-compiling will improve performance, at start up, because you would be skipping that step. The reason that .NET JITs every time an app and its libraries load is so that it can run on many platforms and architectures with the best possible optimizations without the need for managing your builds.

So you have to weigh whether it's worth the admin headaches to save a few seconds on app start up and library loads. I think the most common use case for doing this is for server installs where you tend to manage few machines and the environment is very stable. E.g. you would not pre-compile for client apps because the target environments are much less predictable.

like image 101
Paul Sasik Avatar answered Nov 13 '22 03:11

Paul Sasik