I'm writing an app that adds over 2000 actors to a ClutterGroup. The redraw speed is fine, but there's a very unpleasant lag when adding the actors. I traced it down to the clutter_group_sort_depth_order() in clutter_group_real_add(). It looks like the group is sorting the linked list of children every time an actor is added, which is causing a big performance hit.

What would be the least intrusive way to fix this? Should the z-order sort be queued until redraw time, should something like g_list_insert_sorted() be used instead (dropping from O(n^2logn) to O(n)), or should the entire underlying data structure be changed to something like a GTree (shortening the time to O(log n), but might be very intrusive)?

Patrick
--
To unsubscribe send a mail to [email protected]

Reply via email to