4

I have a project written in .NET 4.0, and have no syntax or feature reason to upgrade it to .NET 4.5 . However, I was wondering if execution performance would improve.

Now, I understand that the IL code will probably remain the same, so performance improvements would come from CLR improvements. But as .NET 4.5 is still running the .NET 4.0 CLR, would there be any noticeable performance improvements by upgrading?

(For sake of completion/exposition, what about an upgrade from .NET 2 CLR to .NET 4 CLR?)

2 Answers 2

7

Right, the CLR version number is still the same and the 4.5 CLR replaces the 4.0 CLR. The revision is however substantial. Short from the language projection that supports WinRT development, the focus for the 4.5 version was in fact on perf improvements.

I'll just briefly describe them, it is already well covered in this magazine article:

  • Multicore JIT. Which compiles IL to machine code on more than one core. Improves warm start time.
  • Profile guided optimization. Ngen.exe pays attention to instrumentation data collected in test runs to optimize the layout of the native code. It improves the cache locality of hot code.
  • Large Object Heap improvements. The LOH has traditionally had a memory fragmentation problem, improved for 4.5
  • Server GC background collections. Available for a while already on the workstation GC, now also supported for the server GC. Reduces the collection pauses.
  • Not mentioned in the article, using Reflection on .NET types is improved by pre-caching the type data for common .NET types.
  • Check the rest of the article for the other changes.
Sign up to request clarification or add additional context in comments.

1 Comment

The magazine article link is broken. It's only been 6 years since this post :P
1

The multicore JIT compiler is available only on 4.5. That alone could give you large performance improvement should you enable it.

It is worth mentioning that by going 4.5 you drop support for widnows xp (which might or might not be an issue).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.