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: Thu, 28 Nov 2024 20:03:33 +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="9180"; 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 Thu Nov 28 21:04:23 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 1tGkkR-0002IW-MT for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Nov 2024 21:04:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkk8-0008IM-4l; Thu, 28 Nov 2024 15:04:04 -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 1tGkk6-0008Hz-SM for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2024 15:04:02 -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 1tGkk6-0005p9-Jb for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2024 15:04:02 -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=bVhrereqlX8SddPoSsRAABY9IjxKbAzmu+3/PLlxC4c=; b=Y2hHgm6BNG9CIKwAYctrd9fuC+4rvPWfxDrnkym4XbY825hOM56nVtrPjuXqLCBpv8V7ejfALXUKnUX/jyop157w8EJaxuk44PMlIDprJXw3AhNIN5Dm44PcZXr8RZOjgox8QEO8u6EDTNmyba0cCJHiPA4crs+CP3Vz5tdZDwrZVjskg1mzTDsbFK7PrZLVjVrf+sRSgzAPPM4LduqxyHMf9StKaxOZpxHo1s6l19Ap5zw7b4AXhbuQXKYA7PKjaRmQob3VDBtDz+Syg2/7qD0Eo/7XR2/nwXvRPOgGQhdnECiyHURa0Fo2A4ncIrgyl1W89m+LsdVAALmG0G/FGw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGkk6-0006Hp-B6 for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2024 15:04: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: Thu, 28 Nov 2024 20:04: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.173282422224131 (code B ref 74357); Thu, 28 Nov 2024 20:04:02 +0000 Original-Received: (at 74357) by debbugs.gnu.org; 28 Nov 2024 20:03:42 +0000 Original-Received: from localhost ([127.0.0.1]:39832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGkjm-0006H9-Er for submit@debbugs.gnu.org; Thu, 28 Nov 2024 15:03:42 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:49906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGkjk-0006Gt-Cl for 74357@debbugs.gnu.org; Thu, 28 Nov 2024 15:03:41 -0500 Original-Received: (qmail 80759 invoked by uid 3782); 28 Nov 2024 21:03:34 +0100 Original-Received: from muc.de (pd953a2a5.dip0.t-ipconnect.de [217.83.162.165]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 28 Nov 2024 21:03:34 +0100 Original-Received: (qmail 15337 invoked by uid 1000); 28 Nov 2024 20:03:33 -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:296066 Archived-At: Hello, Björn. On Fri, Nov 15, 2024 at 22:43:45 +0100, Björn Lindqvist wrote: > Den fre 15 nov. 2024 kl 15:25 skrev Eli Zaretskii : > > Can you tell where in real life do you see such deeply-nested braces > > in C source files? > 50 is perhaps exaggerating it, but in "modern" C++ with multiple > namespaces, nested classes, and anonymous functions you can easily get > scopes nested over a dozen levels deep. In your test file, near the end, holding down the 'y' key as you describe, most of the time CC Mode is scanning for brace lists (and not finding them). ("Brace lists" are things like the initialisation forms for structs and arrays, not statement blocks.) There is a cache mechanism to help reduce this scanning, but with the deep nesting in the test file, it seems to be ineffective, with elements of that cache continually being overwritten by new elements. The cache currently has just four elements. Maybe it would be better to increase that number. Maybe there's some other problem with the cache. I'm looking into it. > -- > mvh/best regards Björn Lindqvist -- Alan Mackenzie (Nuremberg, Germany).