fast path for local D-Bus calls (was: D-Bus is killing me)

John (J5) Palmieri johnp at redhat.com
Mon Dec 18 12:18:20 PST 2006


On Mon, 2006-12-18 at 19:51 +0000, Simon McVittie wrote:
> On Mon, 18 Dec 2006 at 14:10:02 -0500, John (J5) Palmieri wrote:
> > That being said I would argue for doing the in-process shortcutting
> > (along with perhaps a debug mode that will complain if you call into
> > yourself).
> 
> OK, since you've brought it up, I'll mention why this won't quite
> have the efficiency of a local call:
> 
> If you do a remote call to yourself (with no shortcutting), the
> marshal+unmarshal step has the result of deep-copying all objects. This
> means that if the called function mutates its arguments, those changes
> are thrown away. Compare with passing a dict or list to a function by
> reference via a real local call, where the changes take effect in the
> caller too.

I was thinking of shortcutting before creating the message where you
check the dest against an internal list of owned names and call the
method directly in which case the only overhead is the lookup. One thing
I forgot about is you can pass the message into the exported method in
which case this would not work.  Havoc also has some compelling
arguments for knowing when you are doing remote calls.  Of course there
are those like Avahi who want to totally mask these things.  Perhaps in
any case we should have the lookup and error out appropriately when
someone calls a name within their own address space.  We have the info
to even suggest calling the method directly.

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list