D-Bus: Performance improvement practices

2020-06-10 10:41发布

问题:

What are some good practices to obtain better time performance in applications that heavily utilize D-Bus?

Here are a few that our team has learned through the school of hard knocks:

  • Try to combine data entities together into a single, large structure/object to send over D-Bus IPC.
  • Try to have all D-Bus traffic come into a single proxy at a single point in your application/process, rather than having them spread throughout your application/process.

回答1:

There have been a couple of good talks on this subject by the developer of Bustle which is a tool to help you visualise and measure the D-Bus performance of your application and the services its talking too.

  • Profiling and Optimizing D-Bus APIs
  • The Slothful Ways of D-Bus

There is also some D-Bus API design documentation which discusses how to design performant D-Bus APIs. The most important principle is to reduce the number of round-trips your API requires clients to make.



标签: dbus