[Bug 33121] Bind Connection.ContactList.ContactsChangedWithID

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 14 09:45:07 CET 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33121

--- Comment #2 from Olli Salli <ollisal at gmail.com> 2011-03-14 01:45:07 PDT ---
You could add one more thing - an optimization which we can do thanks to this
work: if we have ImmortalHandles AND contactsForHandles is called with no
features (incl. factory features) AND we have injected ids for all of those
handles, satisfy the request without doing the GetContactAttributes call (i.e.
no D-Bus traffic!). To avoid the contact build round-trip was Simon's original
intention in adding the ids everywhere anyway.

Note that while the above optimization doesn't help any when other features are
asked for, as the ContactFactory was only recently added, currently the
majority of applications first do a contact request with no features (mostly
internally in Channel), and then upgrade the contacts (themselves). With the
optimization, we could avoid the first round-trip, while the second one would
still be made, bringing this usage pattern to the same level of performance as
using the ContactFactory with all of the features.

I have to ask: rather than making all these extensive mods to Channel
internals, why not just injectIDs() when you see the ID, and have the queue
logic remain as-is (set-based, not HandleIdentifierMap). In that scheme, the
contact manager would keep the injected IDs during the queue processing. Ditto
for text. No need to change now exclusively for code clarity purposes, though,
but:

As the IDs are now in all kinds of queues - the group change queue, the text
message queue, the tube contact queue - the IDs get injected only when the
queue gets processed, not when we first see them. Therefore, other requests for
contacts with the same handles (but without having knowledge of the ID
themselves, which, as you've discovered, still happens in multiple occasions)
can't use the IDs during that time period. That said, such contact requests
aren't very common. Consider for yourself whether this change would be worth
it.

One trivial suggestion: as immortal handles imply the ID of a given handle
shouldn't change, please warn in injectIDs if we're overwriting an ID we
already had for a handle with a different one. This could help demystify bugs
where either we or the service confuses handles with each other.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list