[maemo-developers] [maemo-developers] Re: Discussion of a possible project - offline calendar project

From: Ross Burton ross at burtonini.com
Date: Wed Jan 17 10:48:05 EET 2007
On Tue, 2007-01-16 at 22:23 +0100, Patrick Ohly wrote:
>       * the showstopper though were performance/timeout issues in the
>         EDS-DBus libraries (see below)


> Anyway, the problem is that after downloading >200 contacts into the
> Nokia 770 e_book_get_contacts() fails with a timeout error. I was able
> to work around that by using e_book_async_get_contacts(), only to find
> that now e_book_get_changes() suffers from the same problem. I suspect
> that it is a DBus method call which is expected to complete more quickly
> than it really does.

Yes, there is a timeout on DBus calls, which isn't that long.  If you
have a lot of contacts EDS has to read every single one into a memory,
create a DBus message and send it back to the client (which gets copied
a number of times with the current bus protocol).  If you profile it
you'll see that memcpy() is the bottleneck here, basically there is too
much data to copy, and not enough memory bandwidth.

The solution is to always use the async methods unless you are coding a
toy application.  If you want to get all contacts, ideally create a book
view -- this means you get informed of the contacts both asynchronously
and incrementally (which is much nicer to system performance as there is
no multi-megabyte message to parse and copy over the bus).  When you
call get_changes, use the async version.

Have you had this working against eds-dbus?  The e_book_get_changes()
method until now was untested in the DBus port, and although I hoped it
worked I hadn't verified it.  If it has been working, that is great

Feel free to mail me any further in-depth questions off-list,
Ross Burton                                 mail: ross at burtonini.com
                                          jabber: ross at burtonini.com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

More information about the maemo-developers mailing list