From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68006: 30.0.50; Image-mode speed Date: Sat, 30 Dec 2023 12:36:54 +0100 Message-ID: <87y1db3ort.fsf@ledu-giraud.fr> References: <87le9jlfd6.fsf@ledu-giraud.fr> <83wmt3bkla.fsf@gnu.org> <87h6k6lgdy.fsf@ledu-giraud.fr> <83wmt29zfy.fsf@gnu.org> <87il4m6rcx.fsf@ledu-giraud.fr> <83bkae9j11.fsf@gnu.org> <87bkadyqdk.fsf@ledu-giraud.fr> <8334voanr1.fsf@gnu.org> <877cl0zvln.fsf@ledu-giraud.fr> <83y1dg954u.fsf@gnu.org> <87zfxvalnq.fsf@ledu-giraud.fr> <83o7eb938y.fsf@gnu.org> <87wmsxmff3.fsf@ledu-giraud.fr> <83mstt5hrk.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35349"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68006@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 30 12:38:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rJXfW-0008ym-3A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Dec 2023 12:38:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJXfH-0000uc-H1; Sat, 30 Dec 2023 06:38:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJXfG-0000uU-0d for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:38:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJXfF-0002sx-Or for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:38:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJXfF-0000rK-PL for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 11:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68006 X-GNU-PR-Package: emacs Original-Received: via spool by 68006-submit@debbugs.gnu.org id=B68006.17039362233238 (code B ref 68006); Sat, 30 Dec 2023 11:38:01 +0000 Original-Received: (at 68006) by debbugs.gnu.org; 30 Dec 2023 11:37:03 +0000 Original-Received: from localhost ([127.0.0.1]:43216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJXeI-0000pz-FE for submit@debbugs.gnu.org; Sat, 30 Dec 2023 06:37:02 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:42072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJXeE-0000ph-TR for 68006@debbugs.gnu.org; Sat, 30 Dec 2023 06:37:00 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=sGlKDl14 jr9ewBy4LMcDwcksBbYRTrGbDXYPKnVP0dc=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=aYn3jYIbOHqeL7APPWtcJYNh+dZv9l EYagaRoVO9OEGTktHNNoZ7vVSrUXLIb+epGOjloY/hRHWEXzeo+JHjDA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=sGlKDl14jr9ewBy4 LMcDwcksBbYRTrGbDXYPKnVP0dc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=BGZ1Y5e7dI2d5AyFAjZeJSJjuu5O7M9aQUzMN3 k6yggF60t0HMoroHCmoZGausGFBvsZHq8iWCupLEUI4T6+WXz3oX5bVyxhG9qF5EgyEpqJ V8PShOJNN12uJY99LCryrwbCFWM1qGbvEZ9N4w/iubPD8cmZiniOol1N0B2bYf9DUlX9sJ wqFLiINLJmpYDOahI4dnFyZtRNdSBp4k8n3K4FW97VySB2DMZvSc4WZZlEMh3KB3u+ek6X GZJDikl6eFE5itjDEcSzVfygNzCtc4NJ1R4SxG/0AdDJArnUbQcSOG+gkBadGl4OM3AndK MbwmiwjF1xU7r6SqG2rVRcyA== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 52b8891c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 30 Dec 2023 12:36:56 +0100 (CET) In-Reply-To: <83mstt5hrk.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 29 Dec 2023 14:13:03 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277079 Archived-At: Eli Zaretskii writes: [...] >> - ;; Discard any stale image data before looking it up again. >> - (image-flush image) >> + (if image-mode-eager-cache-flush >> + ;; Discard any stale image data before looking it up again. >> + (image-flush image) >> + ;; Add a content based hash into image spec to be sure that the >> + ;; cache is updated should the on disk image change. >> + (when (and filename (file-exists-p filename)) >> + (setq image (append image (list :hash (image-contents-sha1 filename)))))) >> + > > I'm probably missing something: how would this assure that if the > image file is replaced, we re-read it from disk? The logic goes like this: - I compute a new hash of the content on disk - This hash is add to the spec - Now a key in the image cache is computed for this spec (i.e. filename, size and *hash* included) - If the hash was changed the cache will miss and read the new image content. If hash and size had not changed the cache will hit and return the correct image. Is it more clear? Or maybe I do not answer your question? I'll try to address your other remarks in a new version of this patch. -- Manuel Giraud