[Mono-devel-list] Cross application domain call optimization

Ben Maurer bmaurer at ximian.com
Sun Oct 17 12:31:29 EDT 2004


On Sun, 2004-10-17 at 11:49 -0400, Ben Maurer wrote:
> > +	for (i = 0; i <= sig->param_count; i++)
> > +		mono_mb_emit_ldarg (mb, i);
> > ...
> > +	if (mono_marshal_supports_fast_xdomain (method)) {
> > +	...
> > +		mono_mb_emit_managed_call (mb, native, native->signature);
> > +		mono_mb_emit_byte (mb, CEE_RET);
> > +		...
> > +	}
> > +	/* wrapper for normal remote calls */
> > +	...
> > +	mono_mb_emit_managed_call (mb, native, native->signature);
> > +	mono_mb_emit_byte (mb, CEE_RET);
> > +...
> > +	mono_mb_emit_managed_call (mb, method, method->signature);
> > +	mono_mb_emit_byte (mb, CEE_RET);
> 
> Rather than loading the args and doing managed calls, you should really
> do CEE_JMP. It is smaller (because you dont push the args on the stack
> either in IL or native code), and faster (jmp is faster than call).

I just tried this on my box. You need to have the following patch to
make it work. This is a bug in mini.

It gives about a 3% boost to xsp with 2 threads going at it. (the reason
is because it avoids ldftn, which is slow right now. Once we fix up
ldftn [lupus and I were talking about it -- both of us actually hacked
up a patch independent of each other.], it should be less).

-- 
Ben Maurer <bmaurer at ximian.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mini-jmp-wrapper-data.patch
Type: text/x-patch
Size: 753 bytes
Desc: 
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041017/dfa842eb/attachment.bin 


More information about the Mono-devel-list mailing list