summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-09-27 10:56:06 +0200
committerEdward Hervey <bilboed@bilboed.com>2009-09-27 10:56:06 +0200
commit4ddc94f55e7b9ea0614a9ba32633a9bc673129e2 (patch)
tree1fc6a0951af38e0e1da73498413c86fe7cb826a1
parent341297fc90766b698cb8b6bbb4e2d26dc49500aa (diff)
test/gobject/performance-threaded: Add complex/emit tests.gobject-performance-rwlock
These are (roughly) the same tests as in performance, except that we can properly test contention with performance-threaded
-rw-r--r--tests/gobject/performance-threaded.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/tests/gobject/performance-threaded.c b/tests/gobject/performance-threaded.c
index bb6347f5e..16e6f5d88 100644
--- a/tests/gobject/performance-threaded.c
+++ b/tests/gobject/performance-threaded.c
@@ -154,7 +154,7 @@ simple_object_get_class_type (void)
}
static void
-simple_creation_destruction_run (gpointer data)
+object_creation_destruction_run (gpointer data)
{
guint i;
for (i = 1000; i; i--) {
@@ -171,6 +171,29 @@ instance_creation_destruction_run (gpointer data)
}
}
+static gpointer
+create_new_complex_object (void)
+{
+ return g_object_new (COMPLEX_TYPE_OBJECT, NULL);
+}
+
+static void
+complex_emission_run (gpointer data)
+{
+ GObject *object = (GObject *) data;
+ guint i;
+
+ for (i = 1000; i; i--) {
+ complex_object_emit (object);
+ }
+}
+
+static void
+complex_emission_teardown (gpointer data)
+{
+ g_object_unref (data);
+}
+
#if 0
/* DUMB test doing nothing */
@@ -234,14 +257,24 @@ static const PerformanceTest tests[] = {
no_teardown },
{ "simple-creation-destruction",
simple_object_get_type,
- simple_creation_destruction_run,
+ object_creation_destruction_run,
no_reset,
no_teardown },
{ "simple-creation-destruction-created",
simple_object_get_class_type,
- simple_creation_destruction_run,
+ object_creation_destruction_run,
+ no_reset,
+ no_teardown },
+ { "complex-creation-destruction",
+ complex_object_get_type,
+ object_creation_destruction_run,
no_reset,
no_teardown },
+ { "emit-signal",
+ create_new_complex_object,
+ complex_emission_run,
+ no_reset,
+ complex_emission_teardown },
#if 0
{ "nothing",
no_setup,