GNOME Bugzilla – Bug 312653
Improving UndoManager performances (bad use of GList)
Last modified: 2009-12-04 04:58:11 UTC
Looking at the code of the undo manager I have seen it uses GList in a very bad way. We could for example cache the length of the undo list (removing all the calls to g_list_length) and the pointer to the last element (removing the calls to g_list_last). We also use g_list_nth_data inside cycles (see gtk_source_undo_manager_undo and gtk_source_undo_manager_free_action_list). Since we usually use g_list_nth[_data] using next_redo as parameter, we could cache a pointer to the list element with index next_redo. We should also investigare the use of g_list_delete_link
Created attachment 53963 [details] [review] improve action list freeing I finally took a quick look at this, and noticed that the way the action list is freed is embarassing: to free a list gets the length of the list and then in a for loop gets the nth element! ugh. The patch factors out a function to free an action (a good idea on its own) and then simply walks the list and frees the elements. The free_action function is then used in other spots of the file. Only lightly tested, but seems straightforward, unless I am missing something... [obviously more of the above optimization ideas should be implemnted]
Created attachment 54052 [details] [review] fix brown paper bug in previous patch :/
Is this bug still valid?
Dear hackers, Any news on this bug ? regards
Patch is set to committed. NEEDINFO as per the last two comments.
Closing this bug report as no further information has been provided. Please feel free to reopen the bug if the problem still occurs with a newer version of GNOME 2.28.0 or later, thanks.