folks, backends: use "small sets" instead of hash sets most of the time
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 4 Apr 2013 12:00:53 +0000 (13:00 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 4 Apr 2013 12:00:53 +0000 (13:00 +0100)
commitab22ced5b97ef63ad206bdd6e3a9270969fb6157
tree23469b0d6b2be0dc1099468e23c69bc7b96904f7
parent87422afd3b6341703f3f4d8718ac5cec8374969a
folks, backends: use "small sets" instead of hash sets most of the time

Notable exceptions are:

* sets of personas that are, or might be, the entire set from a backend
  (possible future refinement: use a SmallSet if there aren't many)

* sets of potentially many Individuals (likewise)

* the object cache (potentially pretty large)

* debug stuff (not relevant for performance)

* the set of IM addresses being matched (we want to keep this O(1),
  but it should be a GHashTable)

This speeds up tests/eds/perf by around 5%.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687161
Reviewed-by: Philip Withnall <philip@tecnocode.co.uk>
[squashed in responses to review -smcv]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
23 files changed:
backends/eds/lib/Makefile.am
backends/eds/lib/edsf-persona-store.vala
backends/eds/lib/edsf-persona.vala
backends/key-file/Makefile.am
backends/key-file/kf-persona-store.vala
backends/key-file/kf-persona.vala
backends/libsocialweb/lib/Makefile.am
backends/libsocialweb/lib/swf-persona.vala
backends/ofono/Makefile.am
backends/ofono/ofono-persona.vala
backends/telepathy/lib/Makefile.am
backends/telepathy/lib/tpf-persona-store-cache.vala
backends/telepathy/lib/tpf-persona-store.vala
backends/telepathy/lib/tpf-persona.vala
backends/tracker/lib/Makefile.am
backends/tracker/lib/trf-persona-store.vala
backends/tracker/lib/trf-persona.vala
folks/Makefile.am
folks/anti-linkable.vala
folks/backend-store.vala
folks/individual-aggregator.vala
folks/individual.vala
folks/potential-match.vala