About performance of D-Bus

Thiago Macieira thiago at kde.org
Thu Oct 25 02:46:13 PDT 2007


Em Thursday 25 October 2007 09:09:47 tian tian escreveu:
>     I want to use D-Bus as communication mechanism between processes. But I
> am not sure if it can work effectually on my PXA310(ARM, about 600MHz), so
> I did some performance test as follows:

My own tests (executed on an Intel Core 2 Duo 2133 MHz).  The payloads were 
byte arrays ("ay") and strings ("s") consisting of the number indicated times 
the letter 'a'. I used stock D-Bus 1.0.2 and Qt 4.4.0 snapshot, compiled in 
release mode.

Note that Qt stores all strings in UTF-16, so the conversion to D-Bus string 
types is O(n). Byte-array passing into libdbus-1 should be O(1). (But 
libdbus-1 will copy it again, so it becomes O(n))

Max call rate (no payload): 5124 calls per second
One-way sending:
256-byteArray) 551168 bytes in 500 ms (in 2153 calls): 1.05127 MB/s
512-byteArray) 1037824 bytes in 500 ms (in 2027 calls): 1.97949 MB/s
1024-byteArray) 1895424 bytes in 500 ms (in 1851 calls): 3.61523 MB/s
2048-byteArray) 3188736 bytes in 500 ms (in 1557 calls): 6.08203 MB/s
4096-byteArray) 4694016 bytes in 500 ms (in 1146 calls): 8.95312 MB/s
8192-byteArray) 6348800 bytes in 500 ms (in 775 calls): 12.1094 MB/s
256-string) 569856 bytes in 500 ms (in 2226 calls): 1.08691 MB/s
512-string) 1126400 bytes in 500 ms (in 2200 calls): 2.14844 MB/s
1024-string) 2204672 bytes in 500 ms (in 2153 calls): 4.20508 MB/s
2048-string) 4265984 bytes in 500 ms (in 2083 calls): 8.13672 MB/s
4096-string) 7454720 bytes in 500 ms (in 1820 calls): 14.2188 MB/s
8192-string) 12402688 bytes in 500 ms (in 1514 calls): 23.6562 MB/s

Round-trip:
256-byteArray) 519168 bytes in 500 ms (in 2028 calls): 0.990234 MB/s
512-byteArray) 933888 bytes in 500 ms (in 1824 calls): 1.78125 MB/s
1024-byteArray) 1591296 bytes in 500 ms (in 1554 calls): 3.03516 MB/s
2048-byteArray) 2422784 bytes in 500 ms (in 1183 calls): 4.62109 MB/s
4096-byteArray) 3166208 bytes in 500 ms (in 773 calls): 6.03906 MB/s
8192-byteArray) 3858432 bytes in 500 ms (in 471 calls): 7.35938 MB/s
256-string) 562944 bytes in 500 ms (in 2199 calls): 1.07373 MB/s
512-string) 1103872 bytes in 500 ms (in 2156 calls): 2.10547 MB/s
1024-string) 2094080 bytes in 500 ms (in 2045 calls): 3.99414 MB/s
2048-string) 3913728 bytes in 500 ms (in 1911 calls): 7.46484 MB/s
4096-string) 6238208 bytes in 500 ms (in 1523 calls): 11.8984 MB/s
8192-string) 9469952 bytes in 500 ms (in 1156 calls): 18.0625 MB/s

I also tested, for comparison, the QtDBus loopback feature. In all of the 
cases below, a DBusMessage was generated:
One-way sending:
256-byteArray) 2403328 bytes in 500 ms (in 9388 calls): 4.58398 MB/s
512-byteArray) 4677632 bytes in 500 ms (in 9136 calls): 8.92188 MB/s
1024-byteArray) 9345024 bytes in 500 ms (in 9126 calls): 17.8242 MB/s
2048-byteArray) 18698240 bytes in 500 ms (in 9130 calls): 35.6641 MB/s
4096-byteArray) 36114432 bytes in 500 ms (in 8817 calls): 68.8828 MB/s
8192-byteArray) 70287360 bytes in 500 ms (in 8580 calls): 134.062 MB/s
256-string) 2275584 bytes in 500 ms (in 8889 calls): 4.34033 MB/s
512-string) 4392448 bytes in 500 ms (in 8579 calls): 8.37793 MB/s
1024-string) 8484864 bytes in 500 ms (in 8286 calls): 16.1836 MB/s
2048-string) 15265792 bytes in 500 ms (in 7454 calls): 29.1172 MB/s
4096-string) 26566656 bytes in 500 ms (in 6486 calls): 50.6719 MB/s
8192-string) 41246720 bytes in 500 ms (in 5035 calls): 78.6719 MB/s

Round-trip:
256-byteArray) 1830144 bytes in 500 ms (in 7149 calls): 3.49072 MB/s
512-byteArray) 3532800 bytes in 500 ms (in 6900 calls): 6.73828 MB/s
1024-byteArray) 7031808 bytes in 500 ms (in 6867 calls): 13.4121 MB/s
2048-byteArray) 13916160 bytes in 500 ms (in 6795 calls): 26.543 MB/s
4096-byteArray) 27201536 bytes in 500 ms (in 6641 calls): 51.8828 MB/s
8192-byteArray) 52224000 bytes in 500 ms (in 6375 calls): 99.6094 MB/s
256-string) 1696768 bytes in 500 ms (in 6628 calls): 3.23633 MB/s
512-string) 3277312 bytes in 500 ms (in 6401 calls): 6.25098 MB/s
1024-string) 6148096 bytes in 500 ms (in 6004 calls): 11.7266 MB/s
2048-string) 10844160 bytes in 500 ms (in 5295 calls): 20.6836 MB/s
4096-string) 17657856 bytes in 500 ms (in 4311 calls): 33.6797 MB/s
8192-string) 25108480 bytes in 500 ms (in 3065 calls): 47.8906 MB/s


And if we bypass libdbus-1 entirely and deliver the calls directly, thereby 
making use of Qt's implicit sharing of byte arrays and strings (i.e., no 
copying, so all O(1)):

Max call rate (no payload): 55496 calls per second
One-way sending:
256-byteArray) 6993664 bytes in 500 ms (in 27319 calls): 13.3394 MB/s
512-byteArray) 13954048 bytes in 500 ms (in 27254 calls): 26.6152 MB/s
1024-byteArray) 28027904 bytes in 500 ms (in 27371 calls): 53.459 MB/s
2048-byteArray) 55910400 bytes in 500 ms (in 27300 calls): 106.641 MB/s
4096-byteArray) 111386624 bytes in 500 ms (in 27194 calls): 212.453 MB/s
8192-byteArray) 224124928 bytes in 500 ms (in 27359 calls): 427.484 MB/s
256-string) 6948608 bytes in 500 ms (in 27143 calls): 13.2534 MB/s
512-string) 14042112 bytes in 500 ms (in 27426 calls): 26.7832 MB/s
1024-string) 28033024 bytes in 500 ms (in 27376 calls): 53.4688 MB/s
2048-string) 55990272 bytes in 500 ms (in 27339 calls): 106.793 MB/s
4096-string) 111841280 bytes in 500 ms (in 27305 calls): 213.32 MB/s
8192-string) 224002048 bytes in 500 ms (in 27344 calls): 427.25 MB/s

Round-trip:
256-byteArray) 7662592 bytes in 500 ms (in 29932 calls): 14.6152 MB/s
512-byteArray) 15290368 bytes in 500 ms (in 29864 calls): 29.1641 MB/s
1024-byteArray) 30626816 bytes in 500 ms (in 29909 calls): 58.416 MB/s
2048-byteArray) 61353984 bytes in 500 ms (in 29958 calls): 117.023 MB/s
4096-byteArray) 122294272 bytes in 500 ms (in 29857 calls): 233.258 MB/s
8192-byteArray) 247668736 bytes in 500 ms (in 30233 calls): 472.391 MB/s
256-string) 7822080 bytes in 500 ms (in 30555 calls): 14.9194 MB/s
512-string) 15633408 bytes in 500 ms (in 30534 calls): 29.8184 MB/s
1024-string) 31473664 bytes in 500 ms (in 30736 calls): 60.0312 MB/s
2048-string) 62844928 bytes in 500 ms (in 30686 calls): 119.867 MB/s
4096-string) 125788160 bytes in 500 ms (in 30710 calls): 239.922 MB/s
8192-string) 251453440 bytes in 500 ms (in 30695 calls): 479.609 MB/s

I cannot explain why I consistently get more calls in a round-trip than with 
one-way.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20071025/30ba6417/attachment.pgp 


More information about the dbus mailing list