hp at pobox.com
Mon Mar 2 14:13:46 PST 2009
On Mon, Mar 2, 2009 at 5:00 PM, Schmottlach, Glenn
<glenn.schmottlach at harman.com> wrote:
> The top five functions where time is spent include the following:
> Function % Time Usage
> ======================= =============
> load_message 14%
> _dbus_header_load 12%
> _dbus_header_get_field_basic 8%
> connection_is_primary_owner 4%
> _dbus_type_get_alignment 2%
> socket_do_iteration 2%
> The rest of the functions are in the noise (> 2%)
Yeah, so this is basically just the message parsing. Interesting to
note here that it seems to be specifically parsing the *header*, which
refutes a bit the speculation that the problem is the daemon looking
at message body.
I think the parsing code probably just isn't fast, and needs some
rearranging and micro-optimization.
You might get somewhat more useful results with sysprof than with gprof.
For optimizing the marshaling code kcachegrind could even be useful,
if it's all CPU-bound, but be cautious because valgrind-based
profiling completely leaves out time spent in IO which is obviously
significant to the dbus big picture. Sometimes CPU-instruction-count
based profiling can be wildly wrong.
More information about the dbus