Index: glib/gbookmarkfile.c
===================================================================
--- glib/gbookmarkfile.c	(revision 6751)
+++ glib/gbookmarkfile.c	(working copy)
@@ -343,7 +343,7 @@ bookmark_metadata_dump (BookmarkMetadata
   if (!metadata->applications)
     return NULL;
   
-  retval = g_string_new (NULL);
+  retval = g_string_sized_new (1024);
   
   /* metadata container */
   g_string_append_printf (retval,
@@ -501,6 +501,7 @@ bookmark_item_dump (BookmarkItem *item)
   GString *retval;
   gchar *added, *visited, *modified;
   gchar *escaped_uri;
+  gchar *buffer;
  
   /* at this point, we must have at least a registered application; if we don't
    * we don't screw up the bookmark file, and just skip this item
@@ -511,37 +512,45 @@ bookmark_item_dump (BookmarkItem *item)
       return NULL;
     }
   
-  retval = g_string_new (NULL);
+  retval = g_string_sized_new (4096);
   
   added = timestamp_to_iso8601 (item->added);
   modified = timestamp_to_iso8601 (item->modified);
   visited = timestamp_to_iso8601 (item->visited);
 
   escaped_uri = g_markup_escape_text (item->uri, -1);
-  
-  g_string_append_printf (retval,
-                          "  <%s %s=\"%s\" %s=\"%s\" %s=\"%s\" %s=\"%s\">\n",
-                          XBEL_BOOKMARK_ELEMENT,
-                          XBEL_HREF_ATTRIBUTE, escaped_uri,
-                          XBEL_ADDED_ATTRIBUTE, added,
-                          XBEL_MODIFIED_ATTRIBUTE, modified,
-                          XBEL_VISITED_ATTRIBUTE, visited);
+
+  buffer = g_strconcat ("  <",
+                        XBEL_BOOKMARK_ELEMENT,
+                        " ",
+                        XBEL_HREF_ATTRIBUTE, "=\"", escaped_uri, "\" ",
+                        XBEL_ADDED_ATTRIBUTE, "=\"", added, "\" ",
+                        XBEL_MODIFIED_ATTRIBUTE, "=\"", modified, "\" ",
+                        XBEL_VISITED_ATTRIBUTE, "=\"", visited, "\">\n",
+                        NULL);
+
+  g_string_append (retval, buffer);
+
   g_free (escaped_uri);
   g_free (visited);
   g_free (modified);
   g_free (added);
+  g_free (buffer);
   
   if (item->title)
     {
       gchar *escaped_title;
       
       escaped_title = g_markup_escape_text (item->title, -1);
-      g_string_append_printf (retval,
-    			      "    <%s>%s</%s>\n",
-    			      XBEL_TITLE_ELEMENT,
-    			      escaped_title,
-    			      XBEL_TITLE_ELEMENT);
+      buffer = g_strconcat ("    ",
+                            "<" XBEL_TITLE_ELEMENT ">",
+                            escaped_title,
+                            "</" XBEL_TITLE_ELEMENT ">\n",
+                            NULL);
+      g_string_append (retval, buffer);
+
       g_free (escaped_title);
+      g_free (buffer);
     }
   
   if (item->description)
@@ -549,34 +558,37 @@ bookmark_item_dump (BookmarkItem *item)
       gchar *escaped_desc;
       
       escaped_desc = g_markup_escape_text (item->description, -1);
-      g_string_append_printf (retval,
-    			      "    <%s>%s</%s>\n",
-    			      XBEL_DESC_ELEMENT,
-    			      escaped_desc,
-    			      XBEL_DESC_ELEMENT);
+      buffer = g_strconcat ("    ",
+                            "<" XBEL_DESC_ELEMENT ">",
+                            escaped_desc,
+                            "</" XBEL_DESC_ELEMENT ">\n",
+                            NULL);
+      g_string_append (retval, buffer);
+
       g_free (escaped_desc);
+      g_free (buffer);
     }
   
   if (item->metadata)
     {
       gchar *metadata;
       
-      /* open info container */
-      g_string_append_printf (retval, "    <%s>\n", XBEL_INFO_ELEMENT);
-      
       metadata = bookmark_metadata_dump (item->metadata);
       if (metadata)
         {
-          retval = g_string_append (retval, metadata);
+          buffer = g_strconcat ("    ",
+                                "<" XBEL_INFO_ELEMENT ">\n",
+                                metadata,
+                                "</" XBEL_INFO_ELEMENT ">\n",
+                                NULL);
+          retval = g_string_append (retval, buffer);
 
+          g_free (buffer);
 	  g_free (metadata);
 	}
-      
-      /* close info container */
-      g_string_append_printf (retval, "    </%s>\n", XBEL_INFO_ELEMENT);
     }
-  
-  g_string_append_printf (retval, "  </%s>\n", XBEL_BOOKMARK_ELEMENT);
+
+  g_string_append (retval, "  </" XBEL_BOOKMARK_ELEMENT ">\n");
   
   return g_string_free (retval, FALSE);
 }
@@ -1437,7 +1449,7 @@ g_bookmark_file_dump (GBookmarkFile  *bo
   GString *retval;
   GList *l;
   
-  retval = g_string_new (NULL);
+  retval = g_string_sized_new (4096);
   
   g_string_append_printf (retval,
   			  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
@@ -3271,7 +3283,7 @@ expand_exec_line (const gchar *exec_fmt,
   GString *exec;
   gchar ch;
   
-  exec = g_string_new (NULL);
+  exec = g_string_sized_new (512);
   while ((ch = *exec_fmt++) != '\0')
    {
      if (ch != '%')
