GNOME Bugzilla – Bug 749533
gdbus APIs are underperforming compared to sd-bus
Last modified: 2018-05-24 17:50:40 UTC
We have compared the user space library cost of gdbus APIs with sd-bus. We have both synchronously and asynchronously retrieved a property from PID 1 for 1, 10, 100 and 1000 times. The results can be seen at https://docs.google.com/document/d/1O3FEnpdZ2auisYalKT6qJTiNV9cfDxya_qisbpGj3MQ/edit#. According to the results, there could be magnitude difference on the cost of user space. I am opening this ticket to discuss if there could be anything done to improve the performance of gdbus. Would it be possible to integrate sd-bus with gdbus for A) improve performance, B) make gdbus kdbus ready. Umut
There are two big things that slow down GDBus: 1) additional context switches caused by sending and receiving via the worker thread 2) remarshalling of all of the data between GVariant and dbus-1 formats Avoiding the worker thread is not something that we can fix in a compatible way. We may introduce new bus types to avoid this in the future, or add a new getter that gets a per-thread connection object that can avoid the worker. The remarshalling situation can never be fixed for as long as we are using standard D-Bus. kdbus will use GVariant natively, so that will automatically be solved if we go to kdbus.
I have noticed even the synchronous calls are using worker thread. Would it add any value avoiding this (at least for the sync calls)?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1039.