From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#51692: 29.0.50; High CPU in c++ mode. Type finder? Date: Fri, 12 Nov 2021 19:08:43 +0000 Message-ID: References: <874k8hpulf.fsf@wavexx.thregr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18035"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51692@debbugs.gnu.org, David Koppelman , Zhiwei Chen , Lars Ingebrigtsen To: Yuri D'Elia Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 12 20:09:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlbvC-0004b8-Ap for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Nov 2021 20:09:10 +0100 Original-Received: from localhost ([::1]:36144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlbvB-0004n6-2O for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Nov 2021 14:09:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlbv4-0004mu-0K for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 14:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlbv3-0004jt-O8 for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 14:09:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlbv3-0002vq-JO for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 14:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Nov 2021 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51692 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo confirmed Original-Received: via spool by 51692-submit@debbugs.gnu.org id=B51692.163674413611256 (code B ref 51692); Fri, 12 Nov 2021 19:09:01 +0000 Original-Received: (at 51692) by debbugs.gnu.org; 12 Nov 2021 19:08:56 +0000 Original-Received: from localhost ([127.0.0.1]:45973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlbuy-0002vU-F8 for submit@debbugs.gnu.org; Fri, 12 Nov 2021 14:08:56 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:45451 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1mlbuv-0002vB-BY for 51692@debbugs.gnu.org; Fri, 12 Nov 2021 14:08:55 -0500 Original-Received: (qmail 354 invoked by uid 3782); 12 Nov 2021 19:08:46 -0000 Original-Received: from acm.muc.de (p4fe15acc.dip0.t-ipconnect.de [79.225.90.204]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 12 Nov 2021 20:08:46 +0100 Original-Received: (qmail 31883 invoked by uid 1000); 12 Nov 2021 19:08:43 -0000 Content-Disposition: inline In-Reply-To: <874k8hpulf.fsf@wavexx.thregr.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219785 Archived-At: Hello, Yuri. On Fri, Nov 12, 2021 at 10:47:46 +0100, Yuri D'Elia wrote: > On Thu, Nov 11 2021, Alan Mackenzie wrote: > > Yes, there is a bug here. CC Mode is expected to use a high amount of > > CPU time (but not 100%) for a few seconds after starting C (etc.) Mode, > > or for a few minutes after starting Emacs when there's a desktop with a > > lot of CC Mode files in it. > > However, with C++ files (and likely Java files, too), a problem with > > templates caused this 100% usage. > High-burst is not a problem, however I have a related question. Is it > normal that repeated C-g didn't abort? No. In this particular scenario, though, the 100% CPU usage was happening in a timer function, so your C-g would just abort the foreground function, i.e. nothing. At least in this situation Emacs wasn't completely frozen, since foreground processing took priority over the background fontification. > There's nothing that seemed to work for me except waiting, which means > that with a few scrolling moves queued I just ended up killing emacs. Ah. Sorry. > I didn't test if there was a difference between JIT/no-JIT versions > (should there ever be in terms of quitting behavior?) I don't know that. But jit is pretty much universal now, apart from for testing purposes by developers. > > Then please report back to the bug list confirming that the bug is > > fixed, or telling me what's still not right. > Tested in both the small test I posted and the full source file I was > working with. Applied on master. Seems to be working perfectly now. Thanks! That's good to hear. I'll just give Zhiwei Chen a little time to reply, and assuming (s)he doesn't find problems, I'll commit the fix. -- Alan Mackenzie (Nuremberg, Germany).