[gspell/wip/improve-perfs: 2/2] timing debug message



commit 4b823d3201718b2ca9fc55f4feade471627893b6
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Apr 1 19:37:52 2017 +0200

    timing debug message

 gspell/gspell-inline-checker-text-buffer.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/gspell/gspell-inline-checker-text-buffer.c b/gspell/gspell-inline-checker-text-buffer.c
index ace867e..b308053 100644
--- a/gspell/gspell-inline-checker-text-buffer.c
+++ b/gspell/gspell-inline-checker-text-buffer.c
@@ -467,7 +467,21 @@ check_visible_region_in_view (GspellInlineCheckerTextBuffer *spell,
                orig_start = start;
                orig_end = end;
 
-               check_subregion (spell, &start, &end);
+               {
+                       GTimer *timer;
+
+                       g_print ("check_subregion [%d, %d]\n",
+                                gtk_text_iter_get_offset (&start),
+                                gtk_text_iter_get_offset (&end));
+
+                       timer = g_timer_new ();
+
+                       check_subregion (spell, &start, &end);
+
+                       g_print ("check_subregion took %lf ms.\n\n",
+                                1000 * g_timer_elapsed (timer, NULL));
+                       g_timer_destroy (timer);
+               }
 
                /* Ensure that we don't have an infinite loop. We must subtract
                 * from scan_region at least [start, end], otherwise we will


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