Subject: Re: bug#41802: 28.0.50; eww triggers 100% CPU consumption when opening page with animated gif

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 17 Jul 2020 03:21:08 +0200

Jhair Tocancipa Triana <[email-masked]> writes:

> I can reproduce the issue with the following steps:
>
> 1) emacs -Q
> 2) M-x eww RET
> 3) https://github.com/drewbarbs/erc-status-sidebar RET
>
> After that CPU consumption rises to 100% until I close the eww buffer
> (see emacs-eww-gif-100-cpu.png).

I guess this depends on the speed of your computer -- I didn't get 100%
CPU utilisation on that particular GIF.

But it's unfortunate that Emacs is so slow to display animated GIFs.  I
have experienced situations where Emacs has become completely unusable,
especially when there's a lot of the animated GIFs.  There is code in
image.el to try to detect when this is happening:

  (when (and (buffer-live-p (plist-get (cdr image) :animate-buffer))
             ;; Delayed more than two seconds more than expected.
	     (or (time-less-p (time-since target-time) 2)
		 (progn
		   (message "Stopping animation; animation possibly too big")
		   nil)))

But perhaps a two-second timeout is too lenient, and it should stop
animations a lot sooner than that.  Or perhaps the code is buggy...

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