[gnome-photos/wip/rishi/double-buffering: 1/12] utils: Log the amout of time spent inside create_buffer_from_node



commit 5752b9f18c8a409ea77c9afb1830ce834259bcd0
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jan 17 12:15:09 2017 +0100

    utils: Log the amout of time spent inside create_buffer_from_node

 src/photos-utils.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 0b0a0a6..fe02bb2 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -37,6 +37,7 @@
 #include <libgd/gd.h>
 
 #include "photos-application.h"
+#include "photos-debug.h"
 #include "photos-facebook-item.h"
 #include "photos-flickr-item.h"
 #include "photos-google-item.h"
@@ -291,6 +292,8 @@ photos_utils_create_buffer_from_node (GeglNode *node)
   GeglBuffer *buffer = NULL;
   GeglNode *buffer_sink;
   GeglNode *graph;
+  gint64 end;
+  gint64 start;
 
   graph = gegl_node_get_parent (node);
   buffer_sink = gegl_node_new_child (graph,
@@ -298,7 +301,14 @@ photos_utils_create_buffer_from_node (GeglNode *node)
                                      "buffer", &buffer,
                                      NULL);
   gegl_node_link (node, buffer_sink);
+
+  start = g_get_monotonic_time ();
+
   gegl_node_process (buffer_sink);
+
+  end = g_get_monotonic_time ();
+  photos_debug (PHOTOS_DEBUG_GEGL, "Utils: Create Buffer from Node: %" G_GINT64_FORMAT, end - start);
+
   g_object_unref (buffer_sink);
 
   return buffer;


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