From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#25706: 26.0.50; Slow C file fontification Date: Tue, 1 Dec 2020 19:59:04 +0100 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 (Mac OS X Mail 12.4 \(3445.104.17\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13374"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 25706@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 01 20:02:55 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 1kkAvO-0003Mq-Fd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 20:02:54 +0100 Original-Received: from localhost ([::1]:59246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkAvN-00018o-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Dec 2020 14:02:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkAsd-0007CV-2W for bug-gnu-emacs@gnu.org; Tue, 01 Dec 2020 14:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkAsc-0008Cy-QK; Tue, 01 Dec 2020 14:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkAsc-0007OR-NO; Tue, 01 Dec 2020 14:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 01 Dec 2020 19:00: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.160684915728313 (code B ref 25706); Tue, 01 Dec 2020 19:00:02 +0000 Original-Received: (at 25706) by debbugs.gnu.org; 1 Dec 2020 18:59:17 +0000 Original-Received: from localhost ([127.0.0.1]:33307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkArt-0007Mb-7g for submit@debbugs.gnu.org; Tue, 01 Dec 2020 13:59:17 -0500 Original-Received: from mail1440c50.megamailservers.eu ([91.136.14.40]:51292 helo=mail264c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkArp-0007MH-T5 for 25706@debbugs.gnu.org; Tue, 01 Dec 2020 13:59:15 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1606849147; bh=4p6tO2qBhddkuV4xA7S26QljgpzLN0Vk2u6Xx8tHk10=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=g/vCqo7zN7+SRYd/aervH0z3EvaKV3JKYFhPqyYe/GQbcfpg5iFkq7JrIIQQt36wM 4qmzGMHlZ01/XSpNn2VST2JD2kFlw3/vKAJAN2JNN206d3oW+79F5hELdHntSRVOEY Yk36KHb45He/IL9jlXv9acBdLwZbF0vphUT4HxTc= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-064ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.6]) (authenticated bits=0) by mail264c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0B1Ix4bQ016979; Tue, 1 Dec 2020 18:59:06 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F1B.5FC6927B.0035, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=FoV7AFjq c=1 sm=1 tr=0 a=Ni+dBsiEfW2GqKMPYZim9A==:117 a=Ni+dBsiEfW2GqKMPYZim9A==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=LErXm7yDL87_JMrtisgA:9 a=QEXdDO2ut3YA:10 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 X-Origin-Country: SE 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:194757 Archived-At: 1 dec. 2020 kl. 16.27 skrev Alan Mackenzie : > Ah. ;-) Do you think the difference might be significantly more if I > were systematically to expunge "\\("s from CC Mode? No, probably not. It's just obvious low-hanging fruit; every little = helps some. Doing so also makes the regexps a little less mystifying for = the reader since the only capture groups left are those actually used. = Finally, it removes or at least raises some hard limits that we had in = the past (from regexp stack overflow). > Add in yet another cache (or fix the existing cache which is buggy) = for > whatever it is that's searching backwards for braces. Are the bugs in the existing cache preventing it from making the cases = under discussion faster? A na=C3=AFve question: the files we are talking about are dominated by = (mostly single-line) preprocessor directives whose fontification should = be invariant of context (as long as they are not inside comments or = strings, but that's not hard to find out). Why do we then spend time = looking for context at all? =46rom profiling, it seems that about 30 % of the time is spent in = c-determine-limit, called from c-fl-decl-start, = c-font-lock-enclosing-decls and c-font-lock-cut-off-declarators (about = 10 % each).=20=