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: Mon, 30 Nov 2020 16:38:29 +0000 Message-ID: References: <55C404DC-1C29-449F-9A49-B20EDFFCFCEA@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2478"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 25706@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 30 17:39:11 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 1kjmCl-0000XT-3X for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Nov 2020 17:39:11 +0100 Original-Received: from localhost ([::1]:47636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjmCk-0005jO-4e for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Nov 2020 11:39:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjmCc-0005j9-9q for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2020 11:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjmCc-0002w0-28; Mon, 30 Nov 2020 11:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kjmCb-00005K-Vs; Mon, 30 Nov 2020 11:39:01 -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: Mon, 30 Nov 2020 16:39:01 +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.160675431932747 (code B ref 25706); Mon, 30 Nov 2020 16:39:01 +0000 Original-Received: (at 25706) by debbugs.gnu.org; 30 Nov 2020 16:38:39 +0000 Original-Received: from localhost ([127.0.0.1]:56461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kjmCF-0008W7-5r for submit@debbugs.gnu.org; Mon, 30 Nov 2020 11:38:39 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:58155 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kjmCD-0008Vq-5r for 25706@debbugs.gnu.org; Mon, 30 Nov 2020 11:38:38 -0500 Original-Received: (qmail 73133 invoked by uid 3782); 30 Nov 2020 16:38:30 -0000 Original-Received: from acm.muc.de (p4fe15abb.dip0.t-ipconnect.de [79.225.90.187]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 30 Nov 2020 17:38:29 +0100 Original-Received: (qmail 9932 invoked by uid 1000); 30 Nov 2020 16:38:29 -0000 Content-Disposition: inline In-Reply-To: <55C404DC-1C29-449F-9A49-B20EDFFCFCEA@acm.org> 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:194655 Archived-At: Hello, Mattias. On Mon, Nov 30, 2020 at 13:46:30 +0100, Mattias Engdegård wrote: > >> https://raw.githubusercontent.com/qca/qcamain_open_hal_public/master/hal/ar9300/osprey_reg_map_macro.h > > I tried reproducing this on a pretty new laptop, and opening the file > > in question (with your settings) took less than a second with Emacs > > 28. > My lappy is less new but not really that slow -- compared to the > hardware of the original reporter it's a speed demon -- but opening the > file takes almost 4 s here. More importantly, scrolling through the > file is painfully slow. > The code in the file is nothing out of the ordinary; it consists of > macros that are 1-3 lines each; definitely not a pathological case. The > entire fontification takes 64 s for this file. > I'd say the complaint is warranted, even if the original reporter is no > longer reachable. Reopen? > Alan, do you have a diagnose? Yes. I've had a look at the file, and it's large and lacking in braces. There are functions in CC Mode which search backwards for opening braces to establish context. When there are none, the search goes back to BOB. Lots of these searches, not efficiently cached, take a long time. It's a problem with CC Mode, not with the source file. It's a known problem, and not easy to fix. -- Alan Mackenzie (Nuremberg, Germany).