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 732084 - gvalue: Avoid expensive checks where possible
gvalue: Avoid expensive checks where possible
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gobject
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-06-23 09:40 UTC by Edward Hervey
Modified: 2018-05-24 16:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gvalue: Avoid expensive checks where possible (6.39 KB, patch)
2014-06-23 09:40 UTC, Edward Hervey
none Details | Review

Description Edward Hervey 2014-06-23 09:40:19 UTC
Various GValue functions use G_IS_VALUE and G_TYPE_IS_VALUE to check
whether the provided GValue or GType is valid. The problem is two-fold:
* Those checks are expensive (sometimes represent more than 50% of the
  total cost of the function!)
* Later calls to g_type_value_table_peek will validate whether the
  GValue (and type) is valid for usage

This commit replaces most calls to G_IS_VALUE and G_TYPE_IS_VALUE
By simpler checks and delegate the full validation to later function
calls

Speeds up these various functions between 20% and .. 300%
Comment 1 Edward Hervey 2014-06-23 09:40:22 UTC
Created attachment 278977 [details] [review]
gvalue: Avoid expensive checks where possible
Comment 2 Edward Hervey 2014-07-09 07:27:54 UTC
Any comments ?
Comment 3 GNOME Infrastructure Team 2018-05-24 16:41:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/894.