Performance: (was Re: [Accessibility] Re: [Accessibility-atspi] D-Bus AT-SPI - The way forward)

Michael Meeks michael.meeks at novell.com
Fri Dec 14 07:49:03 PST 2007


On Thu, 2007-12-13 at 12:15 -0500, Havoc Pennington wrote:
> Rob Taylor wrote:
> > The interesting thing here is even when doing no marshalling and with
> > validation disabled, its still at about 2x against ORBit. What other
> > design decisions do you think might be influencing this?
> 
> I would say first, raw sockets are super fast. There just is not a lot 
> of work the kernel is doing; when we write(), we switch into the kernel 
> and I believe basically memcpy() into the read() buffer on the other 
> side.

	Yes; it's odd - both ORBit2 and gconf seem to use writev (according to
strace), and ORBit2 tries hard, but is perhaps less careful about
getting a single block of memory for the write than d-bus.

> If you trace through what happens to send and receive dbus messages, 
> there is quite a bit of code. We have the whole message queue 
> abstraction with DBusConnection, the DBusPendingCall machinery, thread 
> locking, parsing and marshaling messages, and so forth. None of this 
> code is what I would call micro-optimized; there are lots of function 
> calls, lots of abstractions, plenty of malloc().

	We have a fair bit of this in ORBit2 too though of course; and I
de-soptimised much of that as I wrote it. Having said that, we use
alloca a fair bit - wrt. allocating each de-marshaled parameter eg. but
that has it's own cost in complexity.

> Example protocol features that I think are potentially slow:
>   2) strings are used instead of integer IDs for various things, such as
>      object paths and interfaces

	This is true with a vengance for CORBA - an object id is hideously
verbose & complicated.

> If that speculation is right then it will be tough to get close to raw 
> socket performance, since so many of the above decisions are embedded in 
> the API or protocol.

	I thought we were comparing ORBit2 & d-bus, is a raw socket a trivial
ping character back/forth type app ? [ it'd be interesting to know what
the theoretical maximum was for that for sure ].

	HTH,

		Michael.	

-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the dbus mailing list