Hi,<br><br>Could you please try without blocking call, by attaching a callback function? In my understanding send_with_block() is also <br>not vary good for performance test.<br><br>-Br<br>Naveen<br><br><div><span class="gmail_quote">
On 10/25/07, <b class="gmail_sendername">tian tian</b> <<a href="mailto:mr.zoufeng@gmail.com">mr.zoufeng@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br> 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:<br>1.<br> Use socket to carry data form a process(client) to another process(server):
<br> client.c:<br> gettimeofday()<br> write() /* write 100 bytes data */<br> server.c:<br> read() /* read 100 bytes data */<br> gettimeofday()<br> The interval between the two gettimeofday() is about 180 microseconds.
<br><br>2.<br> Use D-Bus(Ver 1.0.2) to do a remote method call(peer-to-peer):<br> client.c:<br> main()<br> {<br> dbus_connection_open (CONNECTION_ADDRESS, &error);<br><br>
dbus_message_new_method_call()<br> dbus_connection_send_with_reply_and_block()<br><br> gettimeofday()<br> dbus_message_new_method_call()<br> dbus_message_append_args() /* append 100 bytes data as input parameter */
<br> dbus_connection_send_with_reply_and_block() /* */<br> dbus_message_get_args() /* it will get 100 bytes data as output parameter */<br> gettimeofday()<br> }<br>
server.c:<br> main()<br> {<br> server = dbus_server_listen (CONNECTION_ADDRESS, &error);<br> dbus_server_setup_with_g_main (server, NULL);<br> dbus_server_set_new_connection_function (server, new_connection_func, NULL, NULL);
<br> g_main_loop_run()<br> }<br> new_connection_func()<br> {<br> server_conn_ptr = dbus_connection_ref (conn);<br> dbus_connection_setup_with_g_main( server_conn_ptr, NULL );
<br> dbus_connection_add_filter( server_conn_ptr, dbus_filter, loop, NULL );<br> }<br> dbus_filter()<br> {<br> /* handle & response the remote method call */
<br> }<br> The interval between the two gettimeofday() is about 4200 microseconds! (I tried about ten thousands, the value is quite consistent)<br><br> 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!<br><br>
<br>_______________________________________________<br>dbus mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">
http://lists.freedesktop.org/mailman/listinfo/dbus</a><br><br></blockquote></div><br>