attributes: avoid g_strdup in cogl_attribute_new
Calling g_strdup for attribute names was starting to show up in profiles due to calling malloc for new string storage so frequently. This avoids calling g_strdup and calls g_intern_string() instead. For the really common case names we even avoid the cost of g_intern_string since we can trivially relate our internal name_id to a static string. Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
@ -45,7 +45,7 @@ struct _CoglAttribute
|
||||
CoglObject _parent;
|
||||
|
||||
CoglAttributeBuffer *attribute_buffer;
|
||||
char *name;
|
||||
const char *name;
|
||||
CoglAttributeNameID name_id;
|
||||
gsize stride;
|
||||
gsize offset;
|
||||
|
Reference in New Issue
Block a user