Subject: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content

From: Manuel Giraud <[email-masked]>
Date: Sun, 12 Feb 2023 22:53:40 +0100

Stefan Kangas <[email-masked]> writes:

> Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <[email-masked]> writes:
>
>> So, here is another version of the patch.
>
> What is the performance impact of this?  Could we see some benchmarks?

The performance impact is important.  Here are the results from a list
of images of mine:
--8<---------------cut here---------------start------------->8---
(length *images*) -> 3664

(benchmark-run-compiled 10 (dolist (im *images*) (sha1 im)))
 -> (0.367976492 1 0.2809483390000196)
 
(benchmark-run-compiled 10 (dolist (im *images*) (image-dired-contents-sha1 im)))
 -> (72.115512605 84 26.079076938000014)
--8<---------------cut here---------------end--------------->8---

OTOH, using image-dired on a directory of 245 photos before and after
this patch I cannot feel any difference (after the thumbnails are done
of course).

> I routinely open folders with hundreds of files that are several
> megabytes each, so I think this is the type of benchmark I would be
> interested in.  This is common when working with images from a digital
> camera.
>
> If it has too much of a performance impact, we could consider making it
> optional (and disable it by default).

Maybe we could have this in another option for
`image-dired-thumbnail-storage'?  What do you think of
'image-dired-contents?
-- 
Manuel Giraud