After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 605883 - [performance] g_object_new() processes varargs even when there are none
[performance] g_object_new() processes varargs even when there are none
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
2.23.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-01-02 05:03 UTC by Kamal Mostafa
Modified: 2010-01-11 14:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] g_object_new(): skip varargs for simple calls (996 bytes, patch)
2010-01-02 05:08 UTC, Kamal Mostafa
none Details | Review

Description Kamal Mostafa 2010-01-02 05:03:36 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.
Comment 1 Kamal Mostafa 2010-01-02 05:08:23 UTC
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
Comment 2 Benjamin Otte (Company) 2010-01-11 14:52:35 UTC
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