GNU bug report logs - #76609
31.0.50; The 0.1s repeat timer is very CPU-intensive; it might be a bug?

Previous Next

Package: emacs;

Reported by: Eval Exec <execvy <at> gmail.com>

Date: Thu, 27 Feb 2025 13:57:02 UTC

Severity: normal

Found in version 31.0.50

Full log


Message #23 received at 76609 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eval Exec <execvy <at> gmail.com>
Cc: 76609 <at> debbugs.gnu.org
Subject: Re: bug#76609: 31.0.50; The 0.1s repeat timer is very CPU-intensive; 
 it might be a bug?
Date: Thu, 27 Feb 2025 17:07:07 +0200
> From: Eval Exec <execvy <at> gmail.com>
> Date: Thu, 27 Feb 2025 22:38:35 +0800
> Cc: 76609 <at> debbugs.gnu.org
> 
> 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.




This bug report was last modified 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.