From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Lindqvist Newsgroups: gmane.emacs.bugs Subject: bug#74357: c-mode: Some syntactic constructs cause unreasonable typing lag Date: Thu, 14 Nov 2024 21:39:53 +0100 Message-ID: Mime-Version: 1.0 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="6708"; mail-complaints-to="usenet@ciao.gmane.io" To: 74357@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 14 21:41:31 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 1tBgeh-0001dF-3Y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Nov 2024 21:41:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgeP-00057Y-1u; Thu, 14 Nov 2024 15:41:13 -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 1tBgeH-00056P-AU for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 15:41:06 -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 1tBgeE-00048K-NY for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 15:41:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=BV0edTwxH7e9CgubfSze8K3XNCAf9/JdWEpiRRjolyM=; b=oPcHx7Rrrib/dOopUDMoa+LI0DtAr28cKruvkQ9nys6i2RbhaD177Hcm06OYm3BWGT9F5efHZQ9uWRnLVs1QUbEZV+UZjaxdtnkVWAoNNPRoOhXN2tpsM9hVhEGhpVlOW6RRnsXnmqUsFIniTJhqPRFp7mDeR4gnOuFPFi6YAynoWQ81Yf5zhcoAiNh4Ff7gOEneJDufQbjcvZmFXgaWpQIjxFWc8/Bu9VZpnA1HH6qIwqzFV7RmuzRh25A8fPomoCsFmkNeiU8MWTw/5tS/c8X4GYo5qRc88UZca10436jk5VZslj4Pnm/31AtFBP+iW/e7odhS+BpOC2zDfXN+sw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBgeE-0002lF-8u for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 15:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Lindqvist Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2024 20:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74357 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173161681310533 (code B ref -1); Thu, 14 Nov 2024 20:41:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2024 20:40:13 +0000 Original-Received: from localhost ([127.0.0.1]:47436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBgdQ-0002jp-Iz for submit@debbugs.gnu.org; Thu, 14 Nov 2024 15:40:12 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBgdP-0002j6-0E for submit@debbugs.gnu.org; Thu, 14 Nov 2024 15:40:11 -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 1tBgdO-0004Kj-L6 for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 15:40:10 -0500 Original-Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBgdL-00041a-U8 for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2024 15:40:09 -0500 Original-Received: by mail-ua1-x932.google.com with SMTP id a1e0cc1a2514c-851d6c397bbso425888241.2 for ; Thu, 14 Nov 2024 12:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731616805; x=1732221605; darn=gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BV0edTwxH7e9CgubfSze8K3XNCAf9/JdWEpiRRjolyM=; b=K1LdegVA3T/0DNj2gpI/2wo3d+GLYLnFuUwhtNtYs/uJukqrCo9N3SeCCCoDM6aVaF 6ZBg9IquuKwaHx1/FiS3zJtqx8LTsHuwjfGO7tpgnvrtkCmU1l/DtEZNGvSd/+oDcxK4 rm+67z1G/JCjk9s753vVqG/JXD9ty39JjbE0XNrUhEBkH5ktyWUP+Yr9IjFkzSKotIHR M8ISNoD1Jg1iaQKEWYiT9zB70uVDQZN1B7/61uQtrOT7yiOZGkTrRnOpW0yDrnwy7GHP ClkSJQFmTj6J/nMbWUHoX1Auav0JdRh4+Bt7ONFwu/NKpeS5DvDmK8b+6vLA69/js5v9 cHYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731616805; x=1732221605; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BV0edTwxH7e9CgubfSze8K3XNCAf9/JdWEpiRRjolyM=; b=Vq2Aukfl6siqTsAN6+Wicfj5OMZ28mUJKzv4V1o4jbHWR+I0qiAeewV3i+9vEH8nzJ 7K3AlxW4gr17uok81ceXPI30UoykRKRq57Yt/t4gdIQRULusmnnoY+fJAqZ+6TKLSkcb gdItQk5HABej4coJIKRoamFtxNOG/Xg1YqTy/Qbk9efx/6Ugeast1Vfpq4skhjL8Yj7f RQRhSNjvny01/L6f2pR+14GK8yszwAg7znMhuhNnPnbJ70nm/iN1EA94ObOnS8CVn5y8 CKCIEeM/JqsDltnjCKS6+nNLQDidrAPWRG03Cxtj0InTD4Yeczy9NBc0QwXbnFNbG6tH Ovjw== X-Gm-Message-State: AOJu0YzplifDD+NjdDWs+l48iRJnon9SYzitpY1oGGW31hkS31++SPGF f5v41B/PePY57LslGq9wEk3Y3VBdc/nuyX44oMdJ4zz2NC3Fp8sHqVsZsXb6lEXewYco7FYpebT 24Jbwrr8JNJAbe4shbhZSUfKjLEoBowGk X-Google-Smtp-Source: AGHT+IGWeCP4Ba/bzzNstbzodl0UPH8sKs/wEXo6IgkPhWhcBLqclZq/Dgmo84eLykMiawoasV+uQ9b0EtA+Q15ZGvA= X-Received: by 2002:a05:6102:6c7:b0:4ad:5dcd:2c44 with SMTP id ada2fe7eead31-4ad630c01c8mr372352137.16.1731616805387; Thu, 14 Nov 2024 12:40:05 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=bjourne@gmail.com; helo=mail-ua1-x932.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:295367 Archived-At: This bug has been present in c-mode for at least a year, but I haven't gotten around to report it. The reason is that bugs about latency are erratic and tricky to triage. Typing when the cursor is on some syntatic constructs in c-mode causes severe lag on the order of several hundred milliseconds on my (admittedly slow) laptop. The lag makes c-mode almost unusable. Here is an MWE: void foo(uint dc_dim, uint sc_dim, uint fy_dim, uint fx_dim, __global const float * restrict F, uint sy_dim, uint sx_dim, __global const float * restrict S, uint padding, __global float * restrict D) { uint dy_dim =3D sy_dim + 2 * padding - fy_dim + 1; uint dx_dim =3D sx_dim + 2 * padding - fx_dim + 1; // Place cursor at "y" in "dy_dim". Hold "y" and observe lag. uint dn =3D dc_dim * dy_dim * dx_dim; uint sn =3D sc_dim * sy_dim * sx_dim; } I can make typing even laggier by wrapping foo in foo, like this: void foo(...) { ... void foo(uint dc_dim, uint sc_dim, uint fy_dim, uint fx_dim, __global float * restrict F, uint sy_dim, uint sx_dim, __global float * restrict S, uint padding, __global float * restrict D) { uint dy_dim =3D sy_dim + 2 * padding - fy_dim + 1; uint dx_dim =3D sx_dim + 2 * padding - fx_dim + 1; // Place cursor at d[y]_dim. Hold "y". Observe lag in c-mode. uint dn =3D dc_dim * dy_dim * dx_dim; uint sn =3D sc_dim * sy_dim * sx_dim; } } The more times I wrap foo the slower c-mode gets. So if you have a fast computer try nesting foo in foo 50 times... I have observed the same annoying input lag on multiple computers and I don't use any special c-mode configuration. Please cc me as I'm not subscribed to the list. GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) --=20 mvh/best regards Bj=C3=B6rn Lindqvist