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#74357: c-mode: Some syntactic constructs cause unreasonable typing lag Date: Sat, 30 Nov 2024 18:33:27 +0000 Message-ID: References: <86v7wphrmi.fsf@gnu.org> <86ed3cinfg.fsf@gnu.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="18653"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , 74357@debbugs.gnu.org To: =?UTF-8?Q?Bj=C3=B6rn?= Lindqvist Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 30 19:34:18 2024 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 1tHSIM-0004iO-Aa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Nov 2024 19:34:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHSIC-0004ID-1Y; Sat, 30 Nov 2024 13:34:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHSI8-00048f-3D for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 13:34:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHSI6-0002ff-SB for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 13:34:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=X6YBB2rccbE9oxTHU3uSbNcVn1lyu9f1pVP2RXenZA0=; b=FuZnDShUvy252PD8RVZA2YkRH8ayyl3t1sFNvTodUeIQiN1mbprSByZzUh7JzDBMN26tHlXiY9qJEMajC++AM7nYklhZ9jmLoOQTxbWsoAje/j8MzmHJGQxZ/a/WU2fl57l8IFvEW9wGH2jIsZWIBo/rUj1BU56HIO5Tk9ndiWpI1qJDKi5FEfv4jjh9atGfVo+zKfGRd2iLH6sPE3jJ7fQn5neipHhYXcYE/UaIJXBEkn7e5eDHgGA24ossKrDsETpq4Xf/uW19osoQgmTPWGw8doXke0N3BaVtvGrdP1MSGMtoqB3gkOgAc/On1l/qjI+mXdd3Lw8NpeWWojuAYg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHSI6-0001LS-Kj for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 13:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74357 X-GNU-PR-Package: emacs Original-Received: via spool by 74357-submit@debbugs.gnu.org id=B74357.17329916175124 (code B ref 74357); Sat, 30 Nov 2024 18:34:02 +0000 Original-Received: (at 74357) by debbugs.gnu.org; 30 Nov 2024 18:33:37 +0000 Original-Received: from localhost ([127.0.0.1]:49015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHSHh-0001Ka-H8 for submit@debbugs.gnu.org; Sat, 30 Nov 2024 13:33:37 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:37652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHSHf-0001KG-LR for 74357@debbugs.gnu.org; Sat, 30 Nov 2024 13:33:36 -0500 Original-Received: (qmail 75272 invoked by uid 3782); 30 Nov 2024 19:33:28 +0100 Original-Received: from muc.de (pd953a479.dip0.t-ipconnect.de [217.83.164.121]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 30 Nov 2024 19:33:28 +0100 Original-Received: (qmail 9331 invoked by uid 1000); 30 Nov 2024 18:33:27 -0000 Content-Disposition: inline In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296194 Archived-At: Hello, Björn. Thanks for such a prompt reply. On Sat, Nov 30, 2024 at 19:04:31 +0100, Björn Lindqvist wrote: > Hello Alan, > I applied your patch (patch < patch.diff), then I byte-compiled the > changed elisp files (emacs -batch -f batch-byte-compile cc-engine.el, > emacs -batch -f batch-byte-compile cc-mode.el), and then I installed > them over the existing .elc files. Maybe I applied the patch wrong > because it didn't improve performance. You can find a new profiler > report here: > https://gist.github.com/bjourne/c715e15729c841d1f68e00499c622d77 Sorry it hasn't worked, yet. I've had a look at that profiler report, and it seems clear that it's profiling something without the patch applied. In particular, the amount of time taken by c-inside-bracelist-p is ~29% out of the 42% that redisplay_internal is taking. It will also account for a similar part of the garbage collection, giving around 2/3 of the time spent just in c-inside-bracelist-p. The patch ought virtually to eliminate that 2/3 of run time taken by that function, giving a speed increase of a factor of 3. Might it be that your Emacs is still loading native compiled files rather than the new .elc files? Or something like that? > -- > mvh/best regards Björn Lindqvist -- Alan Mackenzie (Nuremberg, Germany).