[Mono-list] inlining of methods using structs

Rüdiger Klaehn rudi@lambda-computing.de
Wed, 18 Aug 2004 16:07:22 +0200

Sijmen Mulder wrote:
>>Good to hear that. Is somebody currently working on that? It could make
>>a big difference with graphical applications (System.Drawing.Point and
>>System.Drawing.PointF) as well as with numerical applications (Complex)
>>and financial applications (System.Decimal).
> I am implementing a 2D game engine, and for blitting and such structs
> are often used (Point, Rectangle, etc), so that would be of great
> interrest to me, too. But how does (or will) this inlining exactly
> work? Is it already done by the JITter or the compiler, or do I have
> to do it myself?
You would not have to do anything. All small methods that do not contain 
complex stuff like loops or exception handling would be inlined. Instant 
factor 4 speed boost :-)

General guidelines on what you have to do to increase the chances of 
things being inlined can be found here (under "method inlining")


This is for the current microsoft JIT, but I guess that similar rules 
apply for mono.