dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]method calls and extra indirection


From: Rhys Weatherley
Subject: Re: [DotGNU]method calls and extra indirection
Date: Fri, 2 Apr 2004 17:28:52 +1000
User-agent: KMail/1.4.3

On Friday 02 April 2004 01:23 am, Gomi Kapoor wrote:

> I am using the current release 0.6.4
> I read the pnet/engine/HACKING file and then tried to
> look for the same in the code.

I'll try to remember to fix that, as it is out of date.  You should always 
check the code as well, because sometimes I forget to update the HACKING file 
to reflect the current situation.  The instructions are very well documented 
in the code.

> OK, so can we say there is an always an indirection
> overhead for every method call?

The "call" instruction takes a pointer to an ILMethod control block, which in 
turn contains the pointer to the start of the converted method code.  So yes, 
an indirection is always required.

However, you should not assume that just because an indirection is required 
that it is therefore slow.  The vast majority of the method call overhead is 
involved in setting up the new stack frame.  Fetching the method code pointer 
is a very small part of the total time needed.

If you wish to optimize method calls, you should look at the frame setup 
overhead.  Eliminating the need to save even one field in "ILCallFrame" would 
impact performance much more than fancy back-patching schemes on the "call" 
instruction.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]