diff options
author | Jonathan Blandford <jrb@redhat.com> | 2005-01-05 20:47:12 (GMT) |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2005-01-05 20:47:12 (GMT) |
commit | 543b948ed9d7fd6c56b671e1d78eb588461863a4 (patch) | |
tree | ec8cd22b88402d76b2b4e9cd3bee4116058b4c36 /shell | |
parent | 1e10240455fefa19a3073213c3fae1f9b4d48e32 (diff) |
bypass GDKSplashOutputDev and just use a normal SplashOutputDev. Speeds
Wed Jan 5 15:38:28 2005 Jonathan Blandford <jrb@redhat.com>
* pdf/xpdf/pdf-document.cc (bitmap_to_pixbuf): bypass
GDKSplashOutputDev and just use a normal SplashOutputDev. Speeds
things up a bit.
* shell/ev-sidebar-thumbnail.c: start of some profiling code.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ev-sidebar-bookmarks.c | 5 | ||||
-rw-r--r-- | shell/ev-sidebar-thumbnails.c | 31 |
2 files changed, 28 insertions, 8 deletions
diff --git a/shell/ev-sidebar-bookmarks.c b/shell/ev-sidebar-bookmarks.c index b215e1e..a81759c 100644 --- a/shell/ev-sidebar-bookmarks.c +++ b/shell/ev-sidebar-bookmarks.c @@ -203,6 +203,7 @@ stack_data_free (IdleStackData *stack_data, g_free (stack_data); } +#if 0 static gboolean do_one_iteration (EvSidebarBookmarks *ev_sidebar_bookmarks) { @@ -298,7 +299,7 @@ populate_bookmarks_idle (gpointer data) #endif return TRUE; } - +#endif void ev_sidebar_bookmarks_clear_document (EvSidebarBookmarks *sidebar_bookmarks) { @@ -349,7 +350,7 @@ ev_sidebar_bookmarks_set_document (EvSidebarBookmarks *sidebar_bookmarks, stack_data->tree_iter = NULL; priv->idle_stack = g_list_prepend (priv->idle_stack, stack_data); - priv->idle_id = g_idle_add (populate_bookmarks_idle, sidebar_bookmarks); + //priv->idle_id = g_idle_add (populate_bookmarks_idle, sidebar_bookmarks); } } diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 4154be3..573af69 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -173,14 +173,33 @@ static gboolean populate_thumbnails_idle (gpointer data) { GTimer *timer; - gint i; - gulong microseconds = 0; + int i; + gdouble time_elapsed = 0; EvSidebarThumbnails *ev_sidebar_thumbnails = EV_SIDEBAR_THUMBNAILS (data); EvSidebarThumbnailsPrivate *priv = ev_sidebar_thumbnails->priv; + +#if PROFILE_THUMB == 1 + static GTimer *total_timer; + static gboolean first_time = TRUE; + + if (first_time) { + total_timer = g_timer_new (); + first_time = FALSE; + g_timer_start (total_timer); + } +#endif + if (priv->current_page == priv->n_pages) { priv->idle_id = 0; +#if PROFILE_THUMB == 1 + time_elapsed = g_timer_elapsed (total_timer, NULL); + g_timer_destroy (total_timer); + g_print ("%d rows done in %f seconds\n", + gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->list_store), NULL), + time_elapsed); +#endif return FALSE; } @@ -189,13 +208,13 @@ populate_thumbnails_idle (gpointer data) g_timer_start (timer); while (do_one_iteration (ev_sidebar_thumbnails)) { i++; - g_timer_elapsed (timer, µseconds); - if (microseconds > IDLE_WORK_LENGTH) + time_elapsed = g_timer_elapsed (timer, NULL); + if (time_elapsed > IDLE_WORK_LENGTH/1000000) break; } g_timer_destroy (timer); -#if 0 - g_print ("%d rows done this idle in %d\n", i, (int)microseconds); +#if PROFILE_THUMB == 2 + g_print ("%d rows done this idle in %f seconds\n", i, time_elapsed); #endif return TRUE; |