After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321696 - use g_list_prepend instead of g_list_append
use g_list_prepend instead of g_list_append
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-17 08:23 UTC by James "Doc" Livingston
Modified: 2005-11-20 06:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (14.57 KB, patch)
2005-11-17 08:25 UTC, James "Doc" Livingston
committed Details | Review

Description James "Doc" Livingston 2005-11-17 08:23:12 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.
Comment 1 James "Doc" Livingston 2005-11-17 08:25:40 UTC
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.
Comment 2 James "Doc" Livingston 2005-11-20 06:10:22 UTC
Committed to cvs.