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: Tue, 1 Dec 2020 15:27:11 +0000 Message-ID: References: <55C404DC-1C29-449F-9A49-B20EDFFCFCEA@acm.org> <27B320DF-8102-4CDF-8C6A-7157EEAACF64@acm.org> <956BCA08-0376-4FAD-B1F7-2087C03F6181@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="22480"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 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 Tue Dec 01 16:28:25 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 1kk7Zp-0005k5-90 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 16:28:25 +0100 Original-Received: from localhost ([::1]:43128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk7Zm-0004Gz-JS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 10:28:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk7ZS-0004F1-Pe for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 10:28:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kk7ZS-00066G-IO; Tue, 01 Dec 2020 10:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kk7ZS-0006CX-Ch; Tue, 01 Dec 2020 10:28: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: Tue, 01 Dec 2020 15:28: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.160683644423758 (code B ref 25706); Tue, 01 Dec 2020 15:28:02 +0000 Original-Received: (at 25706) by debbugs.gnu.org; 1 Dec 2020 15:27:24 +0000 Original-Received: from localhost ([127.0.0.1]:32957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kk7Yp-0006B6-IH for submit@debbugs.gnu.org; Tue, 01 Dec 2020 10:27:24 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:21454 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kk7Yk-0006Ag-Uh for 25706@debbugs.gnu.org; Tue, 01 Dec 2020 10:27:22 -0500 Original-Received: (qmail 53258 invoked by uid 3782); 1 Dec 2020 15:27:12 -0000 Original-Received: from acm.muc.de (p4fe15c10.dip0.t-ipconnect.de [79.225.92.16]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Tue, 01 Dec 2020 16:27:11 +0100 Original-Received: (qmail 8967 invoked by uid 1000); 1 Dec 2020 15:27:11 -0000 Content-Disposition: inline In-Reply-To: <956BCA08-0376-4FAD-B1F7-2087C03F6181@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:194743 Archived-At: Hello, Mattias. On Tue, Dec 01, 2020 at 15:07:02 +0100, Mattias Engdegård wrote: > 1 dec. 2020 kl. 13.57 skrev Alan Mackenzie : > > Just something I threw together a few years ago, and use regularly on > > xdisp.c to check nothing's gone seriously slow/see how well my latest > > optimisation has worked. > Thank you, good, I just wanted to know that we are measuring the same thing! > > How much time does this regexp change save on a "normal" file, such as > > src/xdisp.c? > Not much, but clearly measurable -- about 1.5 % (scrolling benchmark). Ah. ;-) Do you think the difference might be significantly more if I were systematically to expunge "\\("s from CC Mode? > What can be done for big files that mainly consist of preprocessor > definitions? Add in yet another cache (or fix the existing cache which is buggy) for whatever it is that's searching backwards for braces. The cache would look something like (P . St) meaning P is the position of the highest brace before St. P nil would mean there was no opening brace at all before St. So any backward search for a { starting between P and St could just return P, any search starting after St. would only need to search back to St, and so on. It's rather messy and easy not to get right first time, but it could make a tremendous difference to these crazy include files. I put in a cache like that for macros after somebody complained about the sluggishness in his file (which was basically a single 4,000 line macro). -- Alan Mackenzie (Nuremberg, Germany).