Home

Awesome

What is this

This repo tries to give an overview over the landscape of the the different dbus implementations that exists in the rust ecosystem.

  1. https://github.com/KillingSpark/rustbus
  2. https://github.com/diwic/dbus-rs/ (bindings to C library)
  3. https://github.com/diwic/dbus-rs/tree/master/dbus-native
  4. https://github.com/dbus2/zbus/
  5. https://github.com/Arnavion/dbus-pure
  6. https://github.com/srwalter/dbus-bytestream
  7. https://github.com/LinkTed/dbus-message-parser
  8. https://github.com/cmaves/async-rustbus

Note that I am the author of rustbus, but of course I am trying to be as objective as possible here.

Current state

Some benchmarks exist. I plan to add equivalent ones for the missing libs, and more kinds of benchmarks.

The benchmarks

  1. MarshalMix: Build a signal message with mixed params and marshal it
  2. MarshalBigArray: Build a signal message with a big u64 array and marshal it
  3. MarshalStrArray: Build a signal message with a big String array and marshal it
  4. Marshal + Send: Connect to the sessionbus, build a signal and send it to the bus

The dbus-message-parser does not provide any means of sending messages, so this benchmark is omitted.

Current results

I am running this on a Ryzen 3800X (/proc/cpuinfo says: AMD Ryzen 7 3800X). Your values might vary a bit.

I used rustc 1.65.0 (897e37553 2022-11-02) to run these benchmarks.

To replicate these results just run: cargo bench. That will run all benchmarks.

LibraryMarshalMixedMarshalStrArrayMarshalBigArrayMarshal + Send
rustbus3.4257 µs98.394 µs2.1689 µs132.86 µs
dbus-rs168.82 µs1.3286 ms377.54 µs282.87 µs
dbus-native3.3086 µs826.04 µs67.291 µs87.377 µs
dbus-bytestream14.002 µs1.1528 ms150.70 µs112.88 µs
dbus-message-parser35.968 µs4.6027 ms700.71 µsNaN
dbus-pure14.657 µs226.58 µs23.864 µs90.029 µs
zvariant9.1030 µs202.62 µs47.606 µsNaN
zvariant-derive9.1303 µs203.39 µs47.352 µsNaN
rustbus-async4.5583 µs104.72 µs2.2329 µs168.23 µs