About performance of D-Bus
mr.zoufeng at gmail.com
Thu Oct 25 00:09:47 PDT 2007
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:
Use socket to carry data form a process(client) to another
write() /* write 100 bytes data */
read() /* read 100 bytes data */
The interval between the two gettimeofday() is about 180 microseconds.
Use D-Bus(Ver 1.0.2) to do a remote method call(peer-to-peer):
dbus_connection_open (CONNECTION_ADDRESS, &error);
dbus_message_append_args() /* append 100 bytes data as input
dbus_connection_send_with_reply_and_block() /* */
dbus_message_get_args() /* it will get 100 bytes data as
output parameter */
server = dbus_server_listen (CONNECTION_ADDRESS, &error);
dbus_server_setup_with_g_main (server, NULL);
new_connection_func, NULL, NULL);
server_conn_ptr = dbus_connection_ref (conn);
dbus_connection_setup_with_g_main( server_conn_ptr, NULL );
dbus_connection_add_filter( server_conn_ptr, dbus_filter,
loop, NULL );
/* handle & response the remote method call */
The interval between the two gettimeofday() is about 4200 microseconds!
(I tried about ten thousands, the value is quite consistent)
As you can see, compared with socket, D-Bus is much slower. But the FAQ
says D-Bus one-to-one communication was about 2.5x slower than simply
pushing the data raw over a socket. So there must be some mistakes in my
test program. I hope someone can help me. Many thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dbus