GNOME Bugzilla – Bug 321696
use g_list_prepend instead of g_list_append
Last modified: 2005-11-20 06:10:22 UTC
Many places use g_list_append when constructing a list, which turns it from an O(n) to an O(n^2) operation. Particularly bad is removing entries from the library, deleting all entries takes ~90s with my 4000 song library.
Created attachment 54866 [details] [review] patch I've looked at all the places g_list_append is used in the code and come up with this. In most places the list ordering doesn't matter, and in some it can simply be reversed after construction. This reduces the time to remove everything from my library to ~10s.
Committed to cvs.