Subject: Re: bug#76609: 31.0.50; The 0.1s repeat timer is very CPU-intensive; it might be a bug?

From: Eli Zaretskii <[email-masked]>
Date: Thu, 27 Feb 2025 16:27:44 +0200

> From: Eval Exec <[email-masked]>
> Date: Thu, 27 Feb 2025 21:55:40 +0800
> 
> I a 0.1 s repeat timer in emacs -Q, then Emacs's the cpu usage is 30% ~
> 70%.
> I think it's a bug.

I get around 45% with this, but why do you consider this a bug?  Your
timer function perhaps does nothing, but the timer machinery is
invoked every 100 msec, and it does consume CPU.

in addition, when you have a high-frequency timer, the Emacs idle loop
is much more expensive, because instead of waiting inside pselect, it
runs all the loop code every 100 msec.

Maybe I'm missing something, but I don't see a bug here.