[Accessibility] Shoring up D-Bus Accessibility--Can we talk?

Mike Gorse mgorse at novell.com
Tue Jul 20 21:33:02 PDT 2010

Bill et al,

> I haven't read his e-mail, but I doubt that we're seeing significant
> delays because of Python bindings.  Compared to 200 microseconds, how
> much delay can Python add for one method call?  Of course, I'm mostly
> ignorant of the real sources of delay, so I don't really know what I'm
> talking about.

I think that you're right, now that I think about it.  I was only looking 
at the cpu time used by the caller, which isn't the whole picture.  I just 
ran another benchmark calling GetChildren on at-spi-registryd 100000 times 
using libdbus.  The caller used 3 seconds of cpu time (although I didn't 
make any attempt to read the reply messages), at-spi-registryd used 6 
seconds, and dbus-daemon used something like 11 seconds.  Using pygi still 
seems a bit faster than using dbus-python, but it isn't as much of a 
difference as is made by dbus-daemon.

I put my benchmarks up at http://mgorse.freeshell.org/gitest-0.1.tar.gz.

So making peer-to-peer connections should help quite a bit, although it 
would mean some refactoring of atk-bridge and pyatspi, and dbus-daemon 
would not handle signal matching for us anymore, as you alluded to.  But 
it might make the biggest difference in the short term for the amount of 
time that it would take, aside from looking to see if there are simple 
ways to significantly reduce the number of calls being made.

Switching to a gobject-based caching mechanism might still be a good idea 
in the long term--I think that it would improve performance slightly as 
well as potentially making it easier to write bindings in new languages 
(some of the work can be done by gobject-introspection)--but exploring 
other options would seem to make sense in the short term.

And, as you've figured out, libdbus wasn't designed for a use case such as 
ours--performance wasn't a huge consideration, from what I've read.  It 
isn't all that important when you're just sending a few messages around 
once in a while.  It becomes very important if you start to send thousands 
of messages, though.


More information about the Accessibility mailing list