gvalue: Avoid expensive checks where possible
@edwardrv
Submitted by Edward Hervey Link to original bug (#732084)
Description
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%