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#25706: 26.0.50; Slow C file fontification Date: Thu, 10 Dec 2020 08:08:44 +0000 Message-ID: References: <53CC4F6E-716E-4D4B-8903-F32CCB676163@acm.org> <05F2A660-A403-4B81-AE77-416A739160A7@acm.org> <878sa7h1a2.fsf@gmail.com> <874kkvh0ne.fsf@gmail.com> 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="20974"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 25706@debbugs.gnu.org To: Ravine Var Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 10 09:09:17 2020 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 1knH0n-0005Mv-Dg for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 09:09:17 +0100 Original-Received: from localhost ([::1]:35584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knH0l-000109-TZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Dec 2020 03:09:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knH0Z-000102-Ai for bug-gnu-emacs@gnu.org; Thu, 10 Dec 2020 03:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knH0Z-0007u6-2x; Thu, 10 Dec 2020 03:09:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1knH0Y-0002Ca-Tn; Thu, 10 Dec 2020 03:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 10 Dec 2020 08:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25706 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 25706-submit@debbugs.gnu.org id=B25706.16075877348443 (code B ref 25706); Thu, 10 Dec 2020 08:09:02 +0000 Original-Received: (at 25706) by debbugs.gnu.org; 10 Dec 2020 08:08:54 +0000 Original-Received: from localhost ([127.0.0.1]:36934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1knH0P-0002C6-Ix for submit@debbugs.gnu.org; Thu, 10 Dec 2020 03:08:53 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:12374 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1knH0N-0002Br-Bt for 25706@debbugs.gnu.org; Thu, 10 Dec 2020 03:08:52 -0500 Original-Received: (qmail 55448 invoked by uid 3782); 10 Dec 2020 08:08:44 -0000 Original-Received: from acm.muc.de (p4fe15c51.dip0.t-ipconnect.de [79.225.92.81]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Thu, 10 Dec 2020 09:08:44 +0100 Original-Received: (qmail 3926 invoked by uid 1000); 10 Dec 2020 08:08:44 -0000 Content-Disposition: inline In-Reply-To: <874kkvh0ne.fsf@gmail.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) 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:195620 Archived-At: Hello again, Ravine. On Wed, Dec 09, 2020 at 13:17:23 +0530, Ravine Var wrote: > I came across another place where a similar lockup happens > (even with the patches posted here). > https://gitlab.com/wireshark/wireshark/-/raw/master/epan/dissectors/packet-rrc.c > Towards the end of the file, once we get to the function > proto_register_rrc(void), the slowdown of scrolling starts and eventually > things freeze. Outch! That's a 50,000 line long function. ;-( I've lost some naivety about "reasonableness" in the past week or two. > Just copying that function to a smaller C file is enough to > reproduce the issue. (I found that C-M-h is a nifty command to do this.) > I can open a new bug report if required. Would you do this, please. The mechanism for the slowdown in that function is entirely different from that in the .h files with lots of macros. In the .c file, there are lots and lots of braces, and it seems we need a new cache to handle them faster. In the .h files, there are no braces, and we needed to put limits into backward searches. Thanks again for taking the trouble to report all these bugs. -- Alan Mackenzie (Nuremberg, Germany).