Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing Aggressive JIT

Tags:

c#

.net

jit

As .net matures, the JIT capabilities have been improved to be brilliantly lazy. That is, don't produce machine code if it isn't needed. In general, this is a good thing.

However, if I am trying to warmup an application I may prefer an aggressive JIT stance. Is there a way to configure a .net application so that all methods of a class are JIT compiled, simply because -the class was constructed?

If yes, my favorite object-creational pattern could instantiate my appliation's object-graph, and I would have everything JIT-ready simultaneously. That would be nice.

Can this be done?

like image 802
Brent Arias Avatar asked Aug 28 '14 15:08

Brent Arias


1 Answers

As a side note - you could use NGen.exe to produce native image of your dll's at deployment time (NB:It's not a perfect solution - as it has some drawbacks - check out the documentation carefully)

like image 103
Isantipov Avatar answered Sep 30 '22 18:09

Isantipov