Skip to content

gvarianttypeinfo: reduce caching overhead

Previously to this changeset, the GHashTable use for caching GVariantTypeInfo required making copies of type strings so that g_str_hash() and g_str_equal() could be used as the hash/equal functions.

Not only does allocating memory for your lookup string slow things down, but it also results in walking GVariantType multiple times.

This optimizes our hash and equal functions to do a single pass and allows us to avoid copying our lookup key.

Merge request reports

Loading