[gegl] remove internal profiling code
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] remove internal profiling code
- Date: Fri, 16 Mar 2012 22:41:37 +0000 (UTC)
commit 6d4456fc928a942ab519e8ce07f9187f9079c3fd
Author: Ãyvind KolÃs <pippin gimp org>
Date: Fri Mar 16 15:45:00 2012 +0000
remove internal profiling code
examples/float-lookup.c | 16 +-
gegl/Makefile.am | 2 -
gegl/gegl-init.c | 25 ---
gegl/gegl-instrument.c | 341 -----------------------------------
gegl/gegl-instrument.h | 36 ----
gegl/gegl-xml.c | 5 -
gegl/process/gegl-eval-mgr.c | 6 -
gegl/process/gegl-eval-visitor.c | 5 -
gegl/process/gegl-finish-visitor.c | 1 -
gegl/process/gegl-have-visitor.c | 6 -
gegl/process/gegl-prepare-visitor.c | 6 -
11 files changed, 9 insertions(+), 440 deletions(-)
---
diff --git a/examples/float-lookup.c b/examples/float-lookup.c
index c6f6370..fe1e1b8 100644
--- a/examples/float-lookup.c
+++ b/examples/float-lookup.c
@@ -14,7 +14,7 @@ static gfloat passthrough (gfloat in, gpointer data)
return in;
}
-glong gegl_ticks (void);
+glong babl_ticks (void);
#define ITERATIONS 10
#define SAMPLES 10000000
@@ -36,25 +36,27 @@ gint main (int argc, gchar **argv)
}
lookup = gegl_lookup_new (wrapped_sqrt, NULL);
- ticks = gegl_ticks ();
+ ticks = babl_ticks ();
for (i=0;i<ITERATIONS;i++)
for (j=0;j<SAMPLES;j++)
foo = gegl_lookup (lookup, rand[j]);
- ticks = gegl_ticks ()-ticks;
+ ticks = babl_ticks ()-ticks;
g_print ("First run: %i\n", ticks);
+ if (foo)
+ foo = 0;
- ticks = gegl_ticks ();
+ ticks = babl_ticks ();
for (i=0;i<ITERATIONS;i++)
for (j=0;j<SAMPLES;j++)
foo = gegl_lookup (lookup, rand[j]);
- ticks = gegl_ticks ()-ticks;
+ ticks = babl_ticks ()-ticks;
g_print ("Second run: %i\n", ticks);
- ticks = gegl_ticks ();
+ ticks = babl_ticks ();
for (i=0;i<ITERATIONS;i++)
for (j=0;j<SAMPLES;j++)
foo = sqrt (rand[j]);
- ticks = gegl_ticks ()-ticks;
+ ticks = babl_ticks ()-ticks;
g_print ("Just sqrt: %i\n", ticks);
gegl_lookup_free (lookup);
diff --git a/gegl/Makefile.am b/gegl/Makefile.am
index 02a540e..4750162 100644
--- a/gegl/Makefile.am
+++ b/gegl/Makefile.am
@@ -68,7 +68,6 @@ GEGL_introspectable_sources = \
gegl-dot-visitor.c \
gegl-enums.c \
gegl-init.c \
- gegl-instrument.c \
gegl-utils.c \
gegl-lookup.c \
gegl-xml.c \
@@ -81,7 +80,6 @@ GEGL_introspectable_sources = \
gegl-dot.h \
gegl-dot-visitor.h \
gegl-init.h \
- gegl-instrument.h \
gegl-plugin.h \
gegl-types-internal.h \
gegl-xml.h \
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index dad80de..d60aa2c 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -82,7 +82,6 @@ pid_is_running (gint pid)
guint gegl_debug_flags = 0;
-#include "gegl-instrument.h"
#include "gegl-init.h"
#include "module/geglmodule.h"
#include "module/geglmoduledb.h"
@@ -354,8 +353,6 @@ void gegl_tile_storage_cache_cleanup (void);
void
gegl_exit (void)
{
- glong timing = gegl_ticks ();
-
gegl_tile_storage_cache_cleanup ();
gegl_tile_cache_destroy ();
gegl_operation_gtype_cleanup ();
@@ -369,9 +366,6 @@ gegl_exit (void)
babl_exit ();
- timing = gegl_ticks () - timing;
- gegl_instrument ("gegl", "gegl_exit", timing);
-
/* used when tracking buffer and tile leaks */
if (g_getenv ("GEGL_DEBUG_BUFS") != NULL)
{
@@ -380,13 +374,6 @@ gegl_exit (void)
gegl_tile_backend_file_stats ();
gegl_tile_backend_tiledir_stats ();
}
- global_time = gegl_ticks () - global_time;
- gegl_instrument ("gegl", "gegl", global_time);
-
- if (g_getenv ("GEGL_DEBUG_TIME") != NULL)
- {
- g_printf ("\n%s", gegl_instrument_utf8 ());
- }
if (gegl_buffer_leaks ())
g_printf (" buffer-leaks: %i\n", gegl_buffer_leaks ());
@@ -460,16 +447,12 @@ gegl_post_parse_hook (GOptionContext *context,
gpointer data,
GError **error)
{
- glong time;
-
if (config)
return TRUE;
g_assert (global_time == 0);
- global_time = gegl_ticks ();
g_type_init ();
- gegl_instrument ("gegl", "gegl_init", 0);
config = (void*)gegl_config ();
@@ -509,14 +492,10 @@ gegl_post_parse_hook (GOptionContext *context,
}
#endif /* GEGL_ENABLE_DEBUG */
- time = gegl_ticks ();
-
babl_init ();
- gegl_instrument ("gegl_init", "babl_init", gegl_ticks () - time);
gegl_init_i18n ();
- time = gegl_ticks ();
if (!module_db)
{
const gchar *gegl_path = g_getenv ("GEGL_PATH");
@@ -567,12 +546,8 @@ gegl_post_parse_hook (GOptionContext *context,
gegl_module_db_load (module_db, module_path);
g_free (module_path);
}
-
- gegl_instrument ("gegl_init", "load modules", gegl_ticks () - time);
}
- gegl_instrument ("gegl", "gegl_init", gegl_ticks () - global_time);
-
if (g_getenv ("GEGL_SWAP"))
g_object_set (config, "swap", g_getenv ("GEGL_SWAP"), NULL);
if (g_getenv ("GEGL_QUALITY"))
diff --git a/gegl/gegl-xml.c b/gegl/gegl-xml.c
index 10cf408..7db897a 100644
--- a/gegl/gegl-xml.c
+++ b/gegl/gegl-xml.c
@@ -33,7 +33,6 @@
#include "property-types/gegl-curve.h"
#include "property-types/gegl-path.h"
#include "property-types/gegl-paramspecs.h"
-#include "gegl-instrument.h"
#include "gegl-xml.h"
#ifdef G_OS_WIN32
@@ -522,7 +521,6 @@ static void each_ref (gpointer value,
GeglNode *gegl_node_new_from_xml (const gchar *xmldata,
const gchar *path_root)
{
- glong time = gegl_ticks ();
ParseData pd = { 0, };
GMarkupParseContext *context;
gboolean success = FALSE;
@@ -558,9 +556,6 @@ GeglNode *gegl_node_new_from_xml (const gchar *xmldata,
g_markup_parse_context_free (context);
g_hash_table_destroy (pd.ids);
- time = gegl_ticks () - time;
- gegl_instrument ("gegl", "gegl_parse_xml", time);
-
return success ? GEGL_NODE (pd.gegl) : NULL;
}
diff --git a/gegl/process/gegl-eval-mgr.c b/gegl/process/gegl-eval-mgr.c
index 27da126..ae3690e 100644
--- a/gegl/process/gegl-eval-mgr.c
+++ b/gegl/process/gegl-eval-mgr.c
@@ -28,7 +28,6 @@
#include "gegl-debug-rect-visitor.h"
#include "gegl-need-visitor.h"
#include "gegl-have-visitor.h"
-#include "gegl-instrument.h"
#include "graph/gegl-node.h"
#include "gegl-prepare-visitor.h"
#include "gegl-finish-visitor.h"
@@ -131,13 +130,10 @@ gegl_eval_mgr_apply (GeglEvalMgr *self)
GeglNode *root;
GeglBuffer *object;
GeglPad *pad;
- glong time = gegl_ticks ();
gpointer context_id = self;
g_assert (GEGL_IS_EVAL_MGR (self));
- gegl_instrument ("gegl", "process", 0);
-
root=self->node;
pad = gegl_node_get_pad (root, self->pad_name);
/* Use the redirect output NOP of a graph instead of a graph if a traversal
@@ -236,8 +232,6 @@ gegl_eval_mgr_apply (GeglEvalMgr *self)
gegl_visitor_dfs_traverse (self->finish_visitor, GEGL_VISITABLE (root));
g_object_unref (root);
- time = gegl_ticks () - time;
- gegl_instrument ("gegl", "process", time);
if (!pad || !G_IS_OBJECT (object))
{
diff --git a/gegl/process/gegl-eval-visitor.c b/gegl/process/gegl-eval-visitor.c
index 6ae6e45..33dc0f7 100644
--- a/gegl/process/gegl-eval-visitor.c
+++ b/gegl/process/gegl-eval-visitor.c
@@ -30,7 +30,6 @@
#include "operation/gegl-operation-context.h"
#include "graph/gegl-pad.h"
#include "graph/gegl-visitable.h"
-#include "gegl-instrument.h"
#include "operation/gegl-operation-sink.h"
#include "buffer/gegl-region.h"
@@ -89,16 +88,12 @@ gegl_eval_visitor_visit_pad (GeglVisitor *self,
else
{
/* Make the operation do it's actual processing */
- glong time = gegl_ticks ();
GEGL_NOTE (GEGL_DEBUG_PROCESS, "For \"%s\" processing pad '%s' result_rect = %d, %d %dÃ%d",
gegl_pad_get_name (pad), gegl_node_get_debug_name (node),
context->result_rect.x, context->result_rect.y, context->result_rect.width, context->result_rect.height);
gegl_operation_process (operation, context, gegl_pad_get_name (pad),
&context->result_rect);
- time = gegl_ticks () - time;
-
- gegl_instrument ("process", gegl_node_get_operation (node), time);
}
if (gegl_pad_get_num_connections (pad) > 1)
diff --git a/gegl/process/gegl-finish-visitor.c b/gegl/process/gegl-finish-visitor.c
index 630e9b5..d6f5bb2 100644
--- a/gegl/process/gegl-finish-visitor.c
+++ b/gegl/process/gegl-finish-visitor.c
@@ -26,7 +26,6 @@
#include "graph/gegl-node.h"
#include "graph/gegl-pad.h"
#include "graph/gegl-visitable.h"
-#include "gegl-instrument.h"
#include "operation/gegl-operation.h"
diff --git a/gegl/process/gegl-have-visitor.c b/gegl/process/gegl-have-visitor.c
index 6c32435..1c5d30f 100644
--- a/gegl/process/gegl-have-visitor.c
+++ b/gegl/process/gegl-have-visitor.c
@@ -28,7 +28,6 @@
#include "graph/gegl-node.h"
#include "graph/gegl-pad.h"
#include "graph/gegl-visitable.h"
-#include "gegl-instrument.h"
#include "operation/gegl-operation.h"
static void gegl_have_visitor_class_init (GeglHaveVisitorClass *klass);
@@ -58,7 +57,6 @@ gegl_have_visitor_visit_node (GeglVisitor *self,
GeglNode *node)
{
GeglOperation *operation;
- glong time = gegl_ticks ();
GEGL_VISITOR_CLASS (gegl_have_visitor_parent_class)->visit_node (self, node);
if (!node)
@@ -72,8 +70,4 @@ gegl_have_visitor_visit_node (GeglVisitor *self,
gegl_node_get_debug_name (node),
node->have_rect.x, node->have_rect.y, node->have_rect.width, node->have_rect.height);
g_mutex_unlock (node->mutex);
-
- time = gegl_ticks () - time;
- gegl_instrument ("process", gegl_node_get_operation (node), time);
- gegl_instrument (gegl_node_get_operation (node), "defined-region", time);
}
diff --git a/gegl/process/gegl-prepare-visitor.c b/gegl/process/gegl-prepare-visitor.c
index af48e91..b59f30f 100644
--- a/gegl/process/gegl-prepare-visitor.c
+++ b/gegl/process/gegl-prepare-visitor.c
@@ -26,7 +26,6 @@
#include "graph/gegl-node.h"
#include "graph/gegl-pad.h"
#include "graph/gegl-visitable.h"
-#include "gegl-instrument.h"
#include "operation/gegl-operation.h"
@@ -60,8 +59,6 @@ gegl_prepare_visitor_visit_node (GeglVisitor *self,
{
GeglOperation *operation = node->operation;
- glong time = gegl_ticks ();
-
/* call the parent's class (gegl-visitor.c) visit_node function */
GEGL_VISITOR_CLASS (gegl_prepare_visitor_parent_class)->visit_node (self, node);
@@ -98,7 +95,4 @@ gegl_prepare_visitor_visit_node (GeglVisitor *self,
GeglRectangle empty ={0,};
gegl_node_set_need_rect (node, self->context_id, &empty);
}
- time = gegl_ticks () - time;
- gegl_instrument ("process", gegl_node_get_operation (node), time);
- gegl_instrument (gegl_node_get_operation (node), "prepare", time);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]