Improvements in memory footprint of gnome-terminal



Hi.

I compared memory footprint of gnome-terminal from CVS with the one from
Fedora Core rawhide today and found some nice improvements that I can
only explain as coming from the recent changes in vte:

top output from fedora core rawhide with two tabs:

15   0 39572  13m 8640 S  3.3  1.4   0:01.42 gnome-terminal

and from CVS:

15   0 35528  11m 8360 S  2.0  1.2   0:01.46 gnome-terminal

also after removing all traces of s/key support in g-t

15   0 35304  11m 8352 S  3.3  1.2   0:01.02 gnome-terminal

Not sure if this could be attributed to other things like prelinking,
theme differences etc, but it still looks significant enough to mention.
My first guess would be the data structure changes from Benjamin's
performance patches, but that's just a guess.

Would be nice if someone else could test the new vte release and see if
similar results can be reproduced.

size reports these differences with new vte + removal of s/key support:

with s/key:
   text    data     bss     dec
 224303    7316   33056  264675   409e3 gnome-terminal
without s/key:
   text    data     bss     dec     hex filename
 206706    7020     264  213990   343e6 gnome-terminal

Is S/KEY dingus clicking really something we need to support any more? I
mean, the hash functions that are supported here are all cracked ages
ago (md[1-5]) and nobody seemed to be using this except Jonathan from
the very beginning :-)

Smells like bloat to me...

>From the random memory consumption thread dept...

Cheers
Kjartan

PS. Attaching patch to remove S/KEY if someone wants to test that too.

? g-t-size-before-removal-of-skey-support.txt
? skey-removal-diff
? skey/skey-diff
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/Makefile.am,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile.am
--- Makefile.am	1 Mar 2005 01:15:11 -0000	1.41
+++ Makefile.am	3 Mar 2005 10:28:34 -0000
@@ -1,8 +1,6 @@
 
 EFENCE=
 
-SUBDIRS=skey
-
 INCLUDES= TERM_CFLAGS@ \
 	-DTERM_LOCALEDIR=\"$(datadir)/locale\" -DEXECUTABLE_NAME=\"gnome-terminal\" \
 	-DTERM_GLADE_DIR=\"$(gladedir)\" \
@@ -31,8 +29,6 @@ gnome_terminal_SOURCES=				\
 	encoding.h				\
 	profile-editor.c			\
 	profile-editor.h			\
-	skey-popup.c				\
-	skey-popup.h				\
 	terminal.c				\
 	terminal.h				\
 	terminal-accels.c			\
@@ -50,7 +46,7 @@ gnome_terminal_SOURCES=				\
 	simple-x-font-selector.h		\
 	$(EGGFILES)
 
-gnome_terminal_LDADD= $(EFENCE) @TERM_LIBS@ skey/libskey.la
+gnome_terminal_LDADD= $(EFENCE) @TERM_LIBS@ 
 
 gladedir   = $(pkgdatadir)/glade
 glade_DATA = gnome-terminal.glade2
Index: terminal-profile.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-profile.c,v
retrieving revision 1.31
diff -u -p -r1.31 terminal-profile.c
--- terminal-profile.c	3 Nov 2004 23:31:07 -0000	1.31
+++ terminal-profile.c	3 Mar 2005 10:28:34 -0000
@@ -68,7 +68,6 @@
 #define KEY_DELETE_BINDING "delete_binding"
 #define KEY_USE_THEME_COLORS "use_theme_colors"
 #define KEY_USE_SYSTEM_FONT "use_system_font"
-#define KEY_USE_SKEY "use_skey"
 #define KEY_FONT "font"
 
 struct _TerminalProfilePrivate
@@ -128,7 +127,6 @@ struct _TerminalProfilePrivate
   guint scroll_background : 1;
   guint use_theme_colors : 1;
   guint use_system_font : 1;
-  guint use_skey : 1;
   guint forgotten : 1;
 };
 
@@ -291,7 +289,6 @@ terminal_profile_init (TerminalProfile *
   profile->priv->delete_binding = TERMINAL_ERASE_ESCAPE_SEQUENCE;
   profile->priv->use_theme_colors = TRUE;
   profile->priv->use_system_font = TRUE;
-  profile->priv->use_skey = TRUE;
   profile->priv->font = pango_font_description_new ();
   pango_font_description_set_family (profile->priv->font,
                                      "monospace");
@@ -1438,34 +1435,6 @@ terminal_profile_set_use_system_font (Te
 
   g_free (key);
 }
-
-gboolean
-terminal_profile_get_use_skey (TerminalProfile *profile)
-{
-  g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
-
-  return profile->priv->use_skey;
-}
-
-void
-terminal_profile_set_use_skey (TerminalProfile *profile,
-			       gboolean         setting)
-{
-  char *key;
-
-  RETURN_IF_NOTIFYING (profile);
-  
-  key = gconf_concat_dir_and_key (profile->priv->profile_dir,
-                                  KEY_USE_SKEY);
-  
-  gconf_client_set_bool (profile->priv->conf,
-                         key,
-                         setting,
-                         NULL);
-
-  g_free (key);
-}
-
 
 const PangoFontDescription*
 terminal_profile_get_font (TerminalProfile *profile)
Index: terminal-profile.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-profile.h,v
retrieving revision 1.22
diff -u -p -r1.22 terminal-profile.h
--- terminal-profile.h	10 May 2004 04:30:44 -0000	1.22
+++ terminal-profile.h	3 Mar 2005 10:28:34 -0000
@@ -184,7 +184,6 @@ TerminalEraseBinding   terminal_profile_
 
 gboolean               terminal_profile_get_use_theme_colors      (TerminalProfile *profile);
 gboolean               terminal_profile_get_use_system_font       (TerminalProfile *profile);
-gboolean               terminal_profile_get_use_skey              (TerminalProfile *profile);
 const PangoFontDescription* terminal_profile_get_font             (TerminalProfile *profile);
 
 void terminal_profile_set_cursor_blink         (TerminalProfile           *profile,
@@ -258,8 +257,6 @@ void terminal_profile_set_use_theme_colo
 void terminal_profile_set_use_system_font       (TerminalProfile        *profile,
 						 gboolean                setting);
 
-void terminal_profile_set_use_skey              (TerminalProfile        *profile,
-						 gboolean                setting);
 void terminal_profile_set_font                   (TerminalProfile            *profile,
                                                   const PangoFontDescription *font_desc);
 
Index: terminal-screen.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-screen.c,v
retrieving revision 1.99
diff -u -p -r1.99 terminal-screen.c
--- terminal-screen.c	29 Nov 2004 09:40:19 -0000	1.99
+++ terminal-screen.c	3 Mar 2005 10:28:34 -0000
@@ -33,7 +33,6 @@
 #include "terminal-widget.h"
 #include "terminal-profile.h"
 #include "terminal.h"
-#include "skey-popup.h"
 #include <libgnome/gnome-util.h> /* gnome_util_user_shell */
 #include <libgnome/gnome-url.h> /* gnome_url_show */
 #include <libgnomevfs/gnome-vfs-utils.h> /* gnome_vfs_make_uri_from_input */
@@ -534,15 +533,6 @@ reread_profile (TerminalScreen *screen)
   terminal_widget_set_scrollback_lines (term,
                                         terminal_profile_get_scrollback_lines (profile));
 
-  if (terminal_profile_get_use_skey (screen->priv->profile))
-    {
-      terminal_widget_skey_match_add (screen->priv->term,
-				      "s/key [0-9]* [-A-Za-z0-9]*", FLAVOR_SKEY);
-    }
-  else
-    {
-      terminal_widget_skey_match_remove (screen->priv->term);
-    }
   bg_type = terminal_profile_get_background_type (profile);
   
   if (bg_type == TERMINAL_BACKGROUND_IMAGE)
@@ -1660,25 +1650,6 @@ terminal_screen_button_press_event (GtkW
                                  event->y / char_height,
                                  &screen->priv->matched_flavor);
   dingus_button = ((event->button == 1) || (event->button == 2));
-
-  if (dingus_button &&
-      (event->state & GDK_CONTROL_MASK) &&
-      terminal_profile_get_use_skey (screen->priv->profile))
-    {
-      gchar *skey_match;
-
-      skey_match = terminal_widget_skey_check_match (term,
-						     event->x / char_width,
-						     event->y / char_height,
-                                                     NULL);
-      if (skey_match != NULL)
-	{
-	  terminal_skey_do_popup (screen, GTK_WINDOW (terminal_screen_get_window (screen)), skey_match);
-	  g_free (skey_match);
-
-	  return TRUE;
-	}
-    }
 
   if (dingus_button &&
       (event->state & GDK_CONTROL_MASK) &&
Index: terminal-widget-vte.c
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-widget-vte.c,v
retrieving revision 1.34
diff -u -p -r1.34 terminal-widget-vte.c
--- terminal-widget-vte.c	28 Jun 2004 07:44:02 -0000	1.34
+++ terminal-widget-vte.c	3 Mar 2005 10:28:34 -0000
@@ -36,7 +36,6 @@ typedef struct
 typedef struct
 {
   GSList *url_tags;
-  GSList *skey_tags;
 } VteData;
 
 static void
@@ -49,9 +48,6 @@ free_vte_data (gpointer data)
   g_slist_foreach (vte->url_tags, (GFunc) g_free, NULL);
   g_slist_free(vte->url_tags);
 
-  g_slist_foreach (vte->skey_tags, (GFunc) g_free, NULL);
-  g_slist_free(vte->skey_tags);
-  
   g_free (vte);
 }
 
@@ -68,7 +64,6 @@ terminal_widget_new (void)
   data = g_new0 (VteData, 1);
 
   data->url_tags = NULL;
-  data->skey_tags = NULL;
 
   g_object_set_data_full (G_OBJECT (terminal), "terminal-widget-data",
                           data, free_vte_data);
@@ -142,43 +137,6 @@ terminal_widget_match_add               
   data->url_tags = g_slist_append (data->url_tags, tag_data);
 }
 
-void
-terminal_widget_skey_match_add             (GtkWidget            *widget,
-					    const char           *regexp,
-                                            int                   flavor)
-{
-  TagData *tag_data;
-  VteData *data;
-  int tag;
-  
-  data = g_object_get_data (G_OBJECT (widget), "terminal-widget-data");
-
-  tag = vte_terminal_match_add(VTE_TERMINAL(widget), regexp);
-
-  tag_data = g_new0 (TagData, 1);
-  tag_data->tag = tag;
-  tag_data->flavor = flavor;
-
-  data->skey_tags = g_slist_append (data->skey_tags, tag_data);
-}
-
-void
-terminal_widget_skey_match_remove          (GtkWidget            *widget)
-{
-  VteData *data;
-  GSList *tags;
-  
-  data = g_object_get_data (G_OBJECT (widget), "terminal-widget-data");
-
-  for (tags = data->skey_tags; tags != NULL; tags = g_slist_next(tags))
-    vte_terminal_match_remove(VTE_TERMINAL(widget),
-   			      GPOINTER_TO_INT(((TagData*)tags->data)->tag));
-
-  g_slist_foreach (data->skey_tags, (GFunc) g_free, NULL);
-  g_slist_free(data->skey_tags);
-  data->skey_tags = NULL;
-}
-
 char*
 terminal_widget_check_match (GtkWidget *widget,
 			     int        column,
@@ -194,32 +152,6 @@ terminal_widget_check_match (GtkWidget *
 
   match = vte_terminal_match_check(VTE_TERMINAL(widget), column, row, &tag);
   for (tags = data->url_tags; tags != NULL; tags = g_slist_next(tags))
-    if (GPOINTER_TO_INT(((TagData*)tags->data)->tag) == tag)
-      {
-        if (flavor)
-          *flavor = tag;
-        return match;
-      }
-
-  g_free (match);
-  return NULL;
-}
-
-char*
-terminal_widget_skey_check_match (GtkWidget *widget,
-				  int        column,
-				  int        row,
-                                  int       *flavor)
-{
-  VteData *data;
-  GSList *tags;
-  gint tag;
-  char *match;
-   
-  data = g_object_get_data (G_OBJECT (widget), "terminal-widget-data");
-
-  match = vte_terminal_match_check(VTE_TERMINAL(widget), column, row, &tag);
-  for (tags = data->skey_tags; tags != NULL; tags = g_slist_next(tags))
     if (GPOINTER_TO_INT(((TagData*)tags->data)->tag) == tag)
       {
         if (flavor)
Index: terminal-widget.h
===================================================================
RCS file: /cvs/gnome/gnome-terminal/src/terminal-widget.h,v
retrieving revision 1.10
diff -u -p -r1.10 terminal-widget.h
--- terminal-widget.h	28 Jun 2004 07:44:02 -0000	1.10
+++ terminal-widget.h	3 Mar 2005 10:28:34 -0000
@@ -53,18 +53,10 @@ void       terminal_widget_get_padding  
 void       terminal_widget_match_add                  (GtkWidget            *widget,
                                                        const char           *regexp,
                                                        int                   flavor);
-void       terminal_widget_skey_match_add             (GtkWidget            *widget,
-                                                       const char           *regexp,
-                                                       int                   flavor);
 char*      terminal_widget_check_match                (GtkWidget            *widget,
                                                        int                   column,
                                                        int                   row,
                                                        int                  *flavor);
-char*      terminal_widget_skey_check_match           (GtkWidget            *widget,
-                                                       int                   column,
-                                                       int                   row,
-                                                       int                  *flavor);
-void       terminal_widget_skey_match_remove          (GtkWidget            *widget);
 void       terminal_widget_set_word_characters        (GtkWidget            *widget,
                                                        const char           *str);
 void       terminal_widget_set_delete_binding         (GtkWidget            *widget,


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