Igor Kushnir <[email protected]> has granted review: Bug 11817: Slow startup when a folder with many wallpapers is selected https://bugzilla.xfce.org/show_bug.cgi?id=11817
Attachment 6239: Slightly improved git patch https://bugzilla.xfce.org/attachment.cgi?id=6239&action=edit --- Comment #4 from Igor Kushnir <[email protected]> --- Created attachment 6239 --> https://bugzilla.xfce.org/attachment.cgi?id=6239&action=edit Slightly improved git patch Improved my patch (added a comment; small optimization for 0 or 1 image list size) and formatted it with git. I profiled xfdesktop with callgrind/KCachegrind and found that compare_by_collate_key is very slow. When I replaced it with strcmp, both g_list_sort and sort_image_list implementations started in 0.5s with 6192 images. When I completely disabled sorting, the starting time was also 0.5s, so it is only sorting with compare_by_collate_key that is slow. xfdesktop can be further optimized for the Random Order case, when sorting is not useful. For random wallpaper order you could store images in an unsorted array instead of a sorted list. This way not only the sorting overhead would be eliminated, but also O(1) random access would be possible (currently the O(N) random list access is used when choosing the next random image). If you don't want to complicate the code with the array, you could at least sort the list only when Random Order option is/gets disabled. I also profiled xfdesktop-settings, but didn't find anything useful. Maybe it's because of the asynchronous loading of images. http://s10.postimg.org/m6ucayj61/xfdesktop_settings_KCachegrind_screenshot.png _______________________________________________ Xfce-bugs mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce-bugs
