GNOME Bugzilla – Bug 605883
[performance] g_object_new() processes varargs even when there are none
Last modified: 2010-01-11 14:52:35 UTC
g_object_new() calls g_object_new_valist() (and therefore va_start/end()) even when there is no valist, which will be the case for most calls. The attached patch lets g_object_new() skip that pointless varargs processing for simple calls where no varargs properties are supplied. The patch delivers a 15% performance increase for the 'tests/gobject/performance simple-construction' test on my Intel Q9550 with gcc -g -O2. See additional discussion in related bug 597260.
Created attachment 150664 [details] [review] [PATCH] g_object_new(): skip varargs for simple calls g_object_new() avoids useless varargs processing for simple calls with no properties. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=605883
commit f4ccd96ea1a137eb0c533f177ff87290a84ee0d5 Author: Kamal Mostafa <kamal@whence.com> Date: Fri Jan 1 20:36:28 2010 -0800 g_object_new(): skip varargs for simple calls g_object_new() avoids useless varargs processing for simple calls with no properties. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=605883