eds: avoid blocking event processing
authorPatrick Ohly <patrick.ohly@intel.com>
Thu, 21 Feb 2013 18:31:38 +0000 (19:31 +0100)
committerPatrick Ohly <patrick.ohly@intel.com>
Tue, 26 Mar 2013 14:13:52 +0000 (15:13 +0100)
commita480638774368497bce03b1db4297f9436725460
treeda5329d1ea825ec59938c41aa0f410e21fd99170
parent4a5d0e0694995e9bb7db69d6b70452f883c2ccf5
eds: avoid blocking event processing

When there are many incoming D-Bus change notifications, processing of
other D-Bus messages can be delayed considerably. This commit is a
first step towards solving this by caching the change notifications
and processing them with lower priority in a glib idle callback.

Ordering of the changes relative to each other is preserved, so
semantically this is the same as immediate processing.

The worst-case scenario is when contacts get added one-by-one to EDS
address books while folks is running, because then each change
triggers one D-Bus signal. With 2000 contacts and four address books
on a fast laptop, the process hosting folks became unresponsive for
137s. The patch reduced that to 0.1s. The downside is an increase of
total test runtime of 4%.

In the scenario where data is already in EDS when folks starts, the
patch reduced response time from 2.3s to 0.2s.

See https://bugs.freedesktop.org/show_bug.cgi?id=60851#c6 for details.
backends/eds/lib/edsf-persona-store.vala