GNOME Bugzilla – Bug 679978
[PATCH] Optimize gtk_widget_path_copy() by preallocating "elems" array
Last modified: 2012-08-07 04:39:31 UTC
Created attachment 218869 [details] [review] Preallocate "elems" array Using GTK+ 3.4.3 here. gtk_widget_path_copy() currently calls g_array_append_val() in a loop, which is inefficient due to reallocating the array's memory. Calling g_array_set_size() before entering the loop reduces the number of CPU cycles used by roughly 30% in my testing.