[systemd-devel] sd-bus vs gdbus on dbus-daemon

Umut Tezduyar Lindskog umut at tezduyar.com
Fri May 1 00:35:22 PDT 2015


On Thu, Apr 30, 2015 at 11:13 AM, Umut Tezduyar Lindskog
<umut at tezduyar.com> wrote:
> Hi Simon,
>
> On Wed, Apr 29, 2015 at 5:34 PM, Simon McVittie
> <simon.mcvittie at collabora.co.uk> wrote:
>> On 29/04/15 15:08, Umut Tezduyar Lindskog wrote:
>>> We [1] have noticed that there could be up to %50 performance gain on
>>> using sd-bus over gdbus on dbus-daemon.
>> ...
>>> gdbus.c
>>>   - g_dbus_proxy_new_for_bus_sync()
>>>   - 50 x g_dbus_proxy_call_sync()
>>>
>>> sdbus.c
>>>   - sd_bus_open_system()
>>>   - 50 x sd_bus_get_property()
>>
>> If you want to "compare apples with apples", I suggest using the
>> lower-level g_bus_get() and g_dbus_connection_call[_sync]() instead of
>> GDBusProxy. The design and priorities of sd-bus and GDBus are not really
>> very similar, but GDBusProxy is certainly not the closest equivalent you
>> can get.
>
> Thanks for the tip. I will re-run the measurements with
> g_dbus_connection_call_sync(g_bus_get_sync(),...). Just considering
> the traffic in the dbus, I do believe we have compared apple to apple.
> But if you believe we might get even more performance with raw API
> calls, then that is fantastic news!

Unfortunately I didn't get any better result with
g_dbus_connection_call_sync. I have updated the link
(https://drive.google.com/open?id=1O3FEnpdZ2auisYalKT6qJTiNV9cfDxya_qisbpGj3MQ&authuser=0)
with the source code if you would like to double check my work.

Umut

>
>>
>> Also, if your application profile is such that (a) D-Bus is a
>> significant factor in performance, and (b) sending 50 synchronous D-Bus
>> messages per connection is anywhere near realistic, then you are
>> probably not using D-Bus the way it is designed to be used.
>
> Measurement we have done was not about if dbus is the ipc we want or
> not. It was about comparing the performances of two libraries. It
> wouldn't have been fair to compare sending only 1 message on the dbus
> due to the performance penalty of creating a worker thread with gdbus.
> But it really didn't matter. 1, 2, 10, 50, in all cases gdbus
> (GDBusProxy) couldn't performed as good as sd-bus.
>
>>
>> See also <http://permalink.gmane.org/gmane.comp.freedesktop.dbus/13663>.
>>
>> --
>> Simon McVittie
>> Collabora Ltd. <http://www.collabora.com/>
>>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list