Subject: 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 17:07:07 +0200

> From: Eval Exec <[email-masked]>
> Date: Thu, 27 Feb 2025 22:38:35 +0800
> Cc: [email-masked]
> 
> Compare to a bash script:
> while true; do
>   sleep 0.1;
>    date
> done
> 
> above script have 0% CPU usage on my laptop.
> 
> change it to 0.0001:
> while true; do
>   sleep 0.0001;
>    date
> done
> 
> even 0.0001 s repeat, the bash script only have 4% cpu usage.
> 
> So I think a 0.1s repeat timer in Emacs consume 45% is very surprise.
> I think maybe we should improve the timer performance

This is not a serious argument, sorry.  Look at the code Emacs runs in
its idle loop, and you will understand how invalid is any comparison
with a shell script which does little except sleeping for 0.1 sec.