You are correct that in 2022 I could have inspected the 26 locations in
GraphicsMagick and used your smart approach for the locations which
needed it. Instead I fixed the function to be efficient by default, and
documented it. There is always quite a lot to do compared to the time
available to do it.
I am a (now) retired person (as is the leader of the ImageMagick
project) and have been actively soliciting for assistance/mentoring for
several/many years, but assistance has not appeared.
I beg your forgiveness,
Bob
On 7/29/26 10:09, Beauregard,Christophe (ECCC) wrote:
>Appending to a list becomes slower and slower as the list gets longer
and longer if the list reference is not the tail of the list.
I should point out that this change probably wasn't necessary.
With the old AppendImageToList() implementation, callers who needed
faster appends could have already achieved faster performance on a
call like:
(void)AppendImageToList(&thumbnails,resize_image);
By noting that resize_image becomes the list tail, and simply changing
the code to:
(void)AppendImageToList(&thumbnails,resize_image);
thumbnails = resize_image;
then adding:
thumbnails = GetFirstImageInList(thumbnails);
Just outside the loop (like they need to now).
c.