mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
gobject/performance: add "property-set-signaled" test
g_object_set() optimizes the case where there are no signals connected. Add a test that sets the property with signals. Obviously, this one is much slower, since we will freeze and thaw the notifications.
This commit is contained in:
@@ -1146,6 +1146,14 @@ test_set_setup (PerformanceTest *test)
|
||||
* "property-get" test and avoid this by taking an additional reference. */
|
||||
g_object_ref (data->object);
|
||||
|
||||
if (g_str_equal (test->name, "property-set-signaled"))
|
||||
{
|
||||
/* If an object has a listener, then a property set will freeze notifications.
|
||||
* That has an overhead, and we have a separate test for that. */
|
||||
g_signal_connect (data->object, "notify::val2",
|
||||
G_CALLBACK (test_notify_handled_handler), NULL);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1622,6 +1630,17 @@ static PerformanceTest tests[] = {
|
||||
test_set_teardown,
|
||||
test_set_print_result
|
||||
},
|
||||
{
|
||||
"property-set-signaled",
|
||||
complex_object_get_type,
|
||||
45019,
|
||||
test_set_setup,
|
||||
test_set_init,
|
||||
test_set_run,
|
||||
test_set_finish,
|
||||
test_set_teardown,
|
||||
test_set_print_result
|
||||
},
|
||||
{
|
||||
"property-get",
|
||||
complex_object_get_type,
|
||||
|
Reference in New Issue
Block a user