From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Sun, 31 Jul 2022 06:41:42 -0400 Message-ID: References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> <83v8rf5894.fsf@gnu.org> <65cb7c73fd4a999cca00@heytings.org> <8c7321f2f3400a5db9be@heytings.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8060"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56682@debbugs.gnu.org, Eli Zaretskii To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 31 12:42:16 2022 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 1oI6Ol-0001vX-QR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jul 2022 12:42:16 +0200 Original-Received: from localhost ([::1]:51188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oI6Ok-0000sV-I9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jul 2022 06:42:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oI6OY-0000qr-NJ for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 06:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oI6OY-0000Jy-0R for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 06:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oI6OX-0001S2-St for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 06:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jul 2022 10:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.16592641195568 (code B ref 56682); Sun, 31 Jul 2022 10:42:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 31 Jul 2022 10:41:59 +0000 Original-Received: from localhost ([127.0.0.1]:36469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oI6OV-0001Rk-AV for submit@debbugs.gnu.org; Sun, 31 Jul 2022 06:41:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oI6OR-0001RU-VH for 56682@debbugs.gnu.org; Sun, 31 Jul 2022 06:41:58 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B83D580722; Sun, 31 Jul 2022 06:41:49 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 63C1080636; Sun, 31 Jul 2022 06:41:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1659264108; bh=+GlVwN/6To8zAK9M6cEKj/NHaJSwzIUDg0+uPsKW6II=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HcEzh49UWYGUozjMjPPSeO0ip0ouvHzh/scrSOqaC9mjp6awvS1Hto/boBtTe+lPl ZZ9CIpDBHeC/KmFLE8JPBXj7YvLwLp2WNWn3qWu3p0h2fqTsBcheY+y6bE3DfY/A1q ZricNzdwER2n5EL3mUlBfeu7m/epKWjGLBV7h6Aa0IeDkH2vgisZNg9TJCD1uXt08v 8ilo6X41GNWUTdkPz3UGsS2W1crLPKZAzYbYnZwWYpv1PbLDuyKneor++pNffTYkJn 93g910asKBULnopxjlMa0ZXRPSQvMkIeiIGiQQBx20jUEbCOpnM2UA807id2vKPKAf xA7DQCtbyzxeQ== Original-Received: from milanesa (dyn.144-85-174-155.dsl.vtx.ch [144.85.174.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 97F4E12020A; Sun, 31 Jul 2022 06:41:47 -0400 (EDT) In-Reply-To: <8c7321f2f3400a5db9be@heytings.org> (Gregory Heytings's message of "Sun, 31 Jul 2022 08:08:55 +0000") 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:238335 Archived-At: > That's not possible: the narrowing is (really) locked (with un uninterned > symbol), it cannot be undone. What would be possible would be to add an > optional "unlock" argument to widen. But somehow I don't think that would > be TRT, as mode authors who now do a (widen) would simply take the habit to > write (widen t) instead, and the same problems would surface again. Emacs is not in the business of preventing people from shooting themselves in the foot. If we need this narrowing to be enforced because Emacs would otherwise crash, then it's OK, but if not, then we *should* provide a way to undo it. > BTW, my tests show that syntax-ppss can be rather slow, when the file is > large enough (say 1 GB). No doubt. But it's no slower with long lines than with short lines. [ Note that it calls `syntax-propertize` internally, which would need to be considered separately since `syntax-propertize` does work line-by-line, and should hence obey the narrowing. ] Stefan