[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: About performance of D-Bus
From:       "Jerome Philbert" <jerome.philbert () gmail ! com>
Date:       2008-11-04 14:31:12
Message-ID: 9c0d19af0811040631uc44e512lddfb6a46a0c127e8 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks for you reply.
So you say that the best I could gain would be 30-40%.

Do you think it is a bad idea today to use the very old version of DBus used
here ?
http://lists.freedesktop.org/pipermail/dbus/2004-November/001779.html
Too much bugs, API no more compatible ... ?

Jerome

2008/11/4 Havoc Pennington <hp@pobox.com>

> Hi,
>
> On Tue, Nov 4, 2008 at 6:09 AM, Jerome Philbert
> <jerome.philbert@gmail.com> wrote:
> > 100ms / 4.7ms = 21 messages only
> > Moreover, this is the ideal case where the CPU has nothing else to do
> than
> > sending messages ...
> > In the reality, the CPU has lots'of things to do, so I could never send
> up
> > to 21 messages.
> >
>
> On a CPU this slow, it isn't clear that libdbus is remotely usable;
> you may need a dbus implementation (or other ipc system) that is
> making different tradeoffs in the direction of efficiency. Or
> worst-case, you may need to figure out how to avoid some of the ipc.
>
> If you made a dbus library that:
> * always blocked, thus eliminating the need to build DBusMessage
> objects or maintain a message queue or deal with main loop
> * was not thread-safe, thus eliminating locking
> * was not robust against hostile peers, thus eliminating message validation
> * did not ever do checks like dbus_return_if_fail thus eliminating more
> code
> * was not safe against out-of-memory, thus eliminating even more code
> * did not try to "multiplex" code modules with "path registration" or
> "handler registration", thus killing more code and overhead
>
> I think you could have a library that was dramatically smaller and
> faster, fwiw. Basically by making it much less flexible and robust,
> and just being careful about using it. I believe an implementation of
> dbus could be pretty close to raw socket speed by making tradeoffs
> like the above.
>
> Current libdbus I'm sure can be made 30% faster or 40% faster or
> something like that, given enough effort, but if you are only getting
> 21 messages now, then even a 100% speedup would only get you to 42
> messages. If that still won't be enough, I would not dive into libdbus
> optimization, I would figure out how to somehow use dbus less.
>
> Again, we'd definitely love to see someone work on making current
> libdbus faster.
>
> Havoc
>

[Attachment #5 (text/html)]

Thanks for you reply.<br>So you say that the best I could gain would be \
30-40%.<br><br>Do you think it is a bad idea today to use the very old version of \
DBus used here ?<br><a \
href="http://lists.freedesktop.org/pipermail/dbus/2004-November/001779.html">http://lists.freedesktop.org/pipermail/dbus/2004-November/001779.html</a><br>
 Too much bugs, API no more compatible ... ?<br><br>Jerome<br><br><div \
class="gmail_quote">2008/11/4 Havoc Pennington <span dir="ltr">&lt;<a \
href="mailto:hp@pobox.com">hp@pobox.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> Hi,<br>
<div class="Ih2E3d"><br>
On Tue, Nov 4, 2008 at 6:09 AM, Jerome Philbert<br>
&lt;<a href="mailto:jerome.philbert@gmail.com">jerome.philbert@gmail.com</a>&gt; \
wrote:<br> &gt; 100ms / 4.7ms = 21 messages only<br>
&gt; Moreover, this is the ideal case where the CPU has nothing else to do than<br>
&gt; sending messages ...<br>
&gt; In the reality, the CPU has lots&#39;of things to do, so I could never send \
up<br> &gt; to 21 messages.<br>
&gt;<br>
<br>
</div>On a CPU this slow, it isn&#39;t clear that libdbus is remotely usable;<br>
you may need a dbus implementation (or other ipc system) that is<br>
making different tradeoffs in the direction of efficiency. Or<br>
worst-case, you may need to figure out how to avoid some of the ipc.<br>
<br>
If you made a dbus library that:<br>
* always blocked, thus eliminating the need to build DBusMessage<br>
objects or maintain a message queue or deal with main loop<br>
* was not thread-safe, thus eliminating locking<br>
* was not robust against hostile peers, thus eliminating message validation<br>
* did not ever do checks like dbus_return_if_fail thus eliminating more code<br>
* was not safe against out-of-memory, thus eliminating even more code<br>
* did not try to &quot;multiplex&quot; code modules with &quot;path \
registration&quot; or<br> &quot;handler registration&quot;, thus killing more code \
and overhead<br> <br>
I think you could have a library that was dramatically smaller and<br>
faster, fwiw. Basically by making it much less flexible and robust,<br>
and just being careful about using it. I believe an implementation of<br>
dbus could be pretty close to raw socket speed by making tradeoffs<br>
like the above.<br>
<br>
Current libdbus I&#39;m sure can be made 30% faster or 40% faster or<br>
something like that, given enough effort, but if you are only getting<br>
21 messages now, then even a 100% speedup would only get you to 42<br>
messages. If that still won&#39;t be enough, I would not dive into libdbus<br>
optimization, I would figure out how to somehow use dbus less.<br>
<br>
Again, we&#39;d definitely love to see someone work on making current<br>
libdbus faster.<br>
<font color="#888888"><br>
Havoc<br>
</font></blockquote></div><br>



_______________________________________________
dbus mailing list
dbus@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic