[tracker/tracker-store] Performance improvement when registrar disappears



commit bc1b3381714ae3870c66289678f92960acdfcfda
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Jun 16 17:53:10 2009 +0200

    Performance improvement when registrar disappears

 src/plugins/evolution/tracker-evolution-plugin.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/evolution/tracker-evolution-plugin.c b/src/plugins/evolution/tracker-evolution-plugin.c
index aa9e7b2..dbdc9f1 100644
--- a/src/plugins/evolution/tracker-evolution-plugin.c
+++ b/src/plugins/evolution/tracker-evolution-plugin.c
@@ -557,6 +557,19 @@ many_idle_handler (gpointer user_data)
 							    G_TYPE_UINT, (guint) time (NULL),
 							    G_TYPE_INVALID, 
 							    G_TYPE_INVALID);
+			} else {
+				guint t;
+
+				/* Performance improvement: remove all that had 
+				 * this disconnected registrar from the queue */
+
+				for (i = 0; t < many_queue->length; t++) {
+					QueuedSet *remove_candidate;
+					remove_candidate = g_queue_peek_nth (many_queue, t);
+					if (remove_candidate->registrar == queued_set->registrar) {
+						queued_set_free (g_queue_pop_nth (many_queue, t));
+					}
+				}
 			}
 
 			queued_set_free (queued_set);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]