unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: Madhavan Krishnan <krishnanmadhavan000@gmail.com>, 45224@debbugs.gnu.org
Subject: bug#45224: 28.0.50; eww and GIFS (cpu usage shoots through the roof)
Date: Sun, 31 Oct 2021 16:10:29 +0100	[thread overview]
Message-ID: <87pmrlnsbe.fsf@gnus.org> (raw)
In-Reply-To: <CADwFkmmDh4ggQ_poY+XiAwdY5-pfiOZtaaFMk=joVNp_-rQMkA@mail.gmail.com> (Stefan Kangas's message of "Sat, 30 Oct 2021 18:50:19 -0700")

Stefan Kangas <stefan@marxist.se> writes:

> The value of :animate-tardiness is updated in image.el on every
> iteration.  When image.el updates :animate-tardiness, it will never be
> equal to something in the cache and we always get a cache miss!

Ahh!  Yes, this has bit us before, I think (with image.el changing the
plist triggering recalculation unnecessarily.  Uhm...  4aa4a8f9 for
instance.

> Option A) seems ugly to me: why would we be consing up Lisp lists on
> such a low level, which also makes me worry about creating a lot of
> unnecessary garbage.  So I prefer Option B).

Yes, me too.

> The struct also seems more clean to me.  Perhaps there are some
> performance implications I'm not thinking of?  Or perhaps there is
> some even better way to do the cache check than a struct, such as
> using the "image struct" directly?

The problem is that it's not well-defined which elements in the plist
really affect display and which ones don't.  If you change :max-width of
an image plist, then it should definitely affect display, but if you
change :gazonk, then it shouldn't.

So perhaps we should just document which elements that affect display,
and put those fields into the struct?  (And then use the struct instead
of the plist for caching.)  That way, if somebody adds a new field that
affects display, then they know to also update the struct.

> A third alternative is to somehow change image.el to put this
> information outside the image specifier, but that leaves unfixed a
> rather subtle issue with caching.  That issue may or may not bite
> someone later.

That would be a simpler solution -- image.el could easily just use a
hash table to keep track of the data.  But as you say, people will trip
over this elsewhere, too, because stashing data in the plist seems like
such an obvious thing to do.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-10-31 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13 12:45 bug#45224: 28.0.50; eww and GIFS (cpu usage shoots through the roof) Madhavan Krishnan
2020-12-14 17:05 ` Lars Ingebrigtsen
     [not found]   ` <87lfe0fbuv.fsf@gmail.com>
     [not found]     ` <877dpkfbf9.fsf@gmail.com>
2020-12-15  5:41       ` Lars Ingebrigtsen
2020-12-18  9:39         ` Madhavan Krishnan
2020-12-18  9:48           ` Lars Ingebrigtsen
2021-10-31  1:50             ` Stefan Kangas
2021-10-31 15:10               ` Lars Ingebrigtsen [this message]
2022-04-11 16:49                 ` Lars Ingebrigtsen
2022-04-11 17:36                   ` Eli Zaretskii
2021-10-31  1:54             ` Stefan Kangas
2022-04-11 12:38   ` Lars Ingebrigtsen
2022-04-11 12:40     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmrlnsbe.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=45224@debbugs.gnu.org \
    --cc=krishnanmadhavan000@gmail.com \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).