Re: [evolution-patches] etree performance patch



And just for interest sake, here's the mail patch which fixes the rest
of the equation.  This makes scrolling through messages feel almost
snappy again (it is very noticable).

Again perhaps it shouldn't be getting view_changed events or be more
selective about them (i.e. it doesn't need to update the label if the
just the cursor moved), but again, this will do for now.


On Wed, 2005-06-08 at 12:14 +0800, Not Zed wrote:
> 
> Finally tracked down the performance issue I was trying to track down.
> What a pain.
> 
> Anyway basically the problem is that every time the cursor moves, it
> comes through as a 'selection has changed' event, so the etable just
> redraws itself entirely, since it doesn't separately track what state it
> last drew the items in.
> 
> The select model already has events for 'this row has changed', they
> just weren't ever emitted, so this patch makes it emit row-by-row events
> if only a few rows have changed.
> 
> It could probably just do it for every row anyway, or the rendering code
> could track state, but I think i don't care enough.
> 
> This makes a fairly big difference to moving the cursor if you dont show
> the message pane (although it still doesn't keep up with the key
> presses, if you have a long list!  i think something else is causing
> that now).
> 
> This is against gal pre-move.
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
? mail/Evolution-DataServer-Mail-common.c
? mail/Evolution-DataServer-Mail-skels.c
? mail/Evolution-DataServer-Mail-stubs.c
? mail/Evolution-DataServer-Mail.h
? mail/Evolution-DataServer-Mail.idl
? mail/Evolution-Mail-common.c
? mail/Evolution-Mail-skels.c
? mail/Evolution-Mail-stubs.c
? mail/Evolution-Mail.h
? mail/GNOME_Evolution_Mail.oaf
? mail/GNOME_Evolution_Mail.oafinfo
? mail/Mail-common.c
? mail/Mail-skels.c
? mail/Mail-stubs.c
? mail/Mail.h
? mail/Mailer-common.c
? mail/Mailer-skels.c
? mail/Mailer-stubs.c
? mail/Mailer.h
? mail/Makefile.save
? mail/a
? mail/a.diff
? mail/a.out
? mail/a.txt
? mail/all.txt
? mail/blah.c
? mail/blah.ps
? mail/changes.diff
? mail/conf.keys
? mail/day.diff
? mail/diff
? mail/e-plugin.html
? mail/e.diff
? mail/econf.h
? mail/em-message-view.h
? mail/em-security-info.c
? mail/em-store-view.c
? mail/eprofile.20423
? mail/eprofile.7804
? mail/evolution-mail
? mail/evolution-mail-2.4.schemas
? mail/evolution-mail-ops.log
? mail/evolution-mbox-upgrade
? mail/f.diff
? mail/fix.ed
? mail/foo
? mail/hide-empty.diff
? mail/html.diff
? mail/lockdown.txt
? mail/m.diff
? mail/mail-config.c.save
? mail/mail-config.evolution
? mail/mail-search.gladep
? mail/mail-security.gladep
? mail/mail-send-recv.c.save
? mail/mail.diff
? mail/mail.error
? mail/map.sed
? mail/message-list.c.save
? mail/ml.diff
? mail/old
? mail/out
? mail/output.ps
? mail/plugins
? mail/search-types.xml
? mail/store_change.diff
? mail/subscribe-dialog-new.c
? mail/subscribe-dialog.c.new
? mail/subscribe-dialog.glade.backup
? mail/subscribe-dialog.glade.save
? mail/subscribe-dialog.gladep
? mail/test-mt
? mail/today-1.diff
? mail/today-2.diff
? mail/today-3.diff
? mail/today-4.diff
? mail/today-5.diff
? mail/today.diff
? mail/typescript
? mail/week.diff
? mail/default/zh_CN/Makefile
? mail/default/zh_CN/Makefile.in
? mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Elm_Intelligent_Importer.oaf.in
? mail/importers/GNOME_Evolution_Mail_Mbox_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Netscape_Intelligent_Importer.oaf.in
? mail/importers/GNOME_Evolution_Mail_Outlook_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.oaf
? mail/importers/GNOME_Evolution_Mail_Pine_Intelligent_Importer.oaf.in
? mail/importers/am.diff
? mail/importers/b
? mail/importers/elm-importer.c.new
? mail/importers/elm.ps
? mail/importers/im.diff
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3643
diff -u -p -r1.3643 ChangeLog
--- mail/ChangeLog	2 Jun 2005 05:51:40 -0000	1.3643
+++ mail/ChangeLog	8 Jun 2005 04:55:48 -0000
@@ -1,3 +1,8 @@
+2005-06-08  Not Zed  <NotZed Ximian com>
+
+	* mail-component.c (view_changed_cb): make this run a timeout so
+	we don't update too often and suck loads of cpu time.
+
 2005-06-02  Not Zed  <NotZed Ximian com>
 
 	* Evolution-Mail.idl: only let this be included once.
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.117
diff -u -p -r1.117 mail-component.c
--- mail/mail-component.c	2 Jun 2005 05:51:41 -0000	1.117
+++ mail/mail-component.c	8 Jun 2005 04:55:48 -0000
@@ -487,7 +487,7 @@ view_on_url (GObject *emitter, const cha
 }
 
 static void
-view_changed_cb(EMFolderView *emfv, EInfoLabel *el)
+view_changed(EMFolderView *emfv, EInfoLabel *el)
 {
 	if (emfv->folder) {
 		char *name;
@@ -559,6 +559,42 @@ view_changed_cb(EMFolderView *emfv, EInf
 	}
 }
 
+static int
+view_changed_timeout(void *d)
+{
+	EInfoLabel *el = d;
+	EMFolderView *emfv = g_object_get_data((GObject *)el, "folderview");
+
+	view_changed(emfv, el);
+
+	g_object_set_data((GObject *)emfv, "view-changed-timeout", NULL);
+
+	g_object_unref(el);
+	g_object_unref(emfv);
+
+	return 0;
+}
+
+static void
+view_changed_cb(EMFolderView *emfv, EInfoLabel *el)
+{
+	void *v;
+
+	/* This can get called 3 times every cursor move, so
+	   we don't need to/want to run it immediately */
+
+	/* NB: we should have a 'view' struct/object to manage this crap, but this'll do for now */
+	v = g_object_get_data((GObject *)emfv, "view-changed-timeout");
+	if (v) {
+		g_source_remove(GPOINTER_TO_INT(v));
+	} else {
+		g_object_ref(emfv);
+		g_object_ref(el);
+	}
+
+	g_object_set_data((GObject *)emfv, "view-changed-timeout", GINT_TO_POINTER(g_timeout_add(250, view_changed_timeout, el)));
+}
+
 /* Evolution::Component CORBA methods.  */
 
 static void
@@ -630,6 +666,8 @@ impl_createControls (PortableServer_Serv
 
 	g_signal_connect(view_widget, "changed", G_CALLBACK(view_changed_cb), info);
 	g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), info);
+
+	g_object_set_data((GObject*)info, "folderview", view_widget);
 }
 
 static CORBA_boolean


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