Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GAC vs JIT

Tags:

Is everything under the GAC precompiled (ngened)? If so, then all of .NET is precompiled, so it's not possible for the CLR to optimize them at runtime?

Like if you use List in your application then CLR will not be able to optimize the List itself, but only how it's used in your app? Doesn't this defeat the purpose of JIT, to get lots of optimizations at runtime? So effectively losing all the potential optimizations for the BCL?

like image 363
Joan Venge Avatar asked Mar 17 '09 21:03

Joan Venge


1 Answers

No, the GAC is not automatically pre-JITted; however, GAC is a pre-requisite to pre-JIT. Actually, only a small minority of things are pre-JITted. Besides which - if the BCL was pre-JITted, then those optimisations would have already been done by NGEN, so the " losing all the potential optimizations" is a non-issue.

like image 126
Marc Gravell Avatar answered Sep 30 '22 17:09

Marc Gravell