Subject: Re: bug#19776: 25.0.50; HTML rendering is very slow

From: Stefan Monnier <[email-masked]>
Date: Sun, 24 Oct 2021 18:14:41 -0400

Lars Ingebrigtsen [2021-10-24 21:42:24] wrote:
> Eli Zaretskii <[email-masked]> writes:
>> When the timer expires, it delivers a signal, but the signal handler
>> only sets a flag.  The flag is checked when we call maybe_quit, which
>> calls do_pending_atimers.  So a Lisp program that hogs the CPU, and
>> never calls any function that calls maybe_quit, will indeed block
>> atimers.  However, this is rare for real-life Lisp programs, because
>> several core primitives call maybe_quit from time to time.
>
> The use case here was for CPU-hogging Lisp code, though, like
> `shr-insert-document'.  And it doesn't seem to hit any maybe_quits in
> this very synthetic test:

Basically all loops should call `maybe_quit`, so the issue is probably
not that `maybe_quit` is not called often enough, but that for some
reason we don't set the vars that it checks or something like that.

        Stefan