Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I take advantage of JIT compiler optimizations such as method inlining and enrigistation?

0
10 Posted

Can I take advantage of JIT compiler optimizations such as method inlining and enrigistation?

0
10

Yes you can, although it may not be obvious and it’s hard to do in many cases. Please keep in mind that any attempt to take advantage of JIT optimizations should not be a motivation or excuse for a code which is poorly architected and hard to maintain. Method Inlining The .NET Compact Framework JIT compiler will inline simple methods to eliminate the cost associated with a method call. Inlining involves replacing the method’s argumenets with the values passed at call time, and eliminating the call completely. The inlining rules differ from version to version of the Compact Framework. In version 1.0, only very simple functions that returned a field from their “this” argument or a constant value could be inlined. In version 2.0, the rules are more generous but are still severely limited. In order to be inlined, a method must have: – 16 bytes of IL or less – No branching (typically an “if”) – No local variables – No exception handlers – No 32-bit floating point arguments or return value –

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123