Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the .NET CLR Really Optimize for the Current Processor

When I read about the performance of JITted languages like C# or Java, authors usually say that they should/could theoretically outperform many native-compiled applications. The theory being that native applications are usually just compiled for a processor family (like x86), so the compiler cannot make certain optimizations as they may not truly be optimizations on all processors. On the other hand, the CLR can make processor-specific optimizations during the JIT process.

Does anyone know if Microsoft's (or Mono's) CLR actually performs processor-specific optimizations during the JIT process? If so, what kind of optimizations?

like image 312
dewald Avatar asked Mar 08 '10 22:03

dewald


People also ask

Which of the following 3 components are the internal content of CLR?

Internally CLR includes the JIT(Just-In-Time) compiler which converts the MSIL code to machine code which further executed by CPU. CLR also uses the . NET Framework class libraries.

Is .NET Core slow?

Net Core 3.1-compiled code runs around 30% more slowly than the same code compiled for .

Which component of CLR supports memory management?

In the common language runtime (CLR), the garbage collector (GC) serves as an automatic memory manager. The garbage collector manages the allocation and release of memory for an application. For developers working with managed code, this means that you don't have to write code to perform memory management tasks.


1 Answers

From back in 2005, David Notario listed several specific targeted optimizations is his blog entry "Does the JIT take advantage of my CPU?". I can't find anything about the new CLR 4, but I imagine several new items are included.

like image 179
Sam Harwell Avatar answered Oct 08 '22 11:10

Sam Harwell