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: Fri, 05 Aug 2022 09:17:21 -0400 Message-ID: References: <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <8c7321f2f36494299e61@heytings.org> <8c7321f2f336523624e3@heytings.org> <83r1202meh.fsf@gnu.org> <6020ffaf-9069-0070-76cf-a13379ef01b5@yandex.ru> <83les71ilg.fsf@gnu.org> <06c5560d-3009-e5a5-3d33-fe5d2ec32d6b@yandex.ru> <74ddc877f17a06d8f120@heytings.org> <100d08b3-c25b-683f-6def-39052107ab59@yandex.ru> <83h72r16g1.fsf@gnu.org> <640c2e07-98e1-96d6-bb02-19f5f03f637f@yandex.ru> <834jyq29o1.fsf@gnu.org> <92da07bd028e3ede61a6@heytings.org> <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> 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="33127"; 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, Gregory Heytings , Eli Zaretskii To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 05 15:18:53 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 1oJxE4-0008Q4-BO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 15:18:52 +0200 Original-Received: from localhost ([::1]:38966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJxE3-0002kY-5J for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 09:18:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJxDH-0002hQ-KH for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 09:18:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJxDG-0000L2-Bx for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 09:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJxDG-0001VG-67 for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 09:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Aug 2022 13:18:02 +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.16597054545742 (code B ref 56682); Fri, 05 Aug 2022 13:18:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 5 Aug 2022 13:17:34 +0000 Original-Received: from localhost ([127.0.0.1]:56714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJxCo-0001UY-4q for submit@debbugs.gnu.org; Fri, 05 Aug 2022 09:17:34 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJxCm-0001UM-VN for 56682@debbugs.gnu.org; Fri, 05 Aug 2022 09:17:33 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8C513441094; Fri, 5 Aug 2022 09:17:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8D6F844002B; Fri, 5 Aug 2022 09:17:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1659705445; bh=TVK5E3nMWGh/cJjNueXlU2a/Nk+Tl9WwhbtW5gMbWJY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WUAF9934ho2NbTTwHmpsTEh/mH6K2xfvsi+vBxxL41YA/ReuXmHJyQbvIMlm7mbVp qERe7WFc65sx1Gj8+CVYyCOcu6+7GftnzA4kwSlKhgGQBA5W79afMAHKvLyjCWmWlb QqieHE7xJDS0DwgYbnPLUtkYMBWGJNPHFRPyEB4riPSuSrfQDWyM42JFI7UtJLs2Mp l1Akf6Ku9C6xG2mZvZteO+ZMDvxzaCnqQqIqfzu7/kEHlCSTE9gjzXY3MuVFtVWV19 6seEq9QtOV4/4vgxe8rkhezW19Z1DHxIWbSCV7iG0admyWhli9aWkAL16zQZkAcxar ccfVtsRtkg4+g== Original-Received: from milanesa (net-5-89-24-238.cust.vodafonedsl.it [5.89.24.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1D74C1201CA; Fri, 5 Aug 2022 09:17:23 -0400 (EDT) In-Reply-To: <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> (Dmitry Gutov's message of "Fri, 5 Aug 2022 15:50:35 +0300") 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:238912 Archived-At: > Do our users regularly edit 30MB files? Thanks to Gregory's changes, it may start becoming more common. > And do a lot of changes in them? In my experience, not very much, no. Usually large files are machine-generated and rarely edited by hand. But there are still relevant use-cases like opening a large JSON/XML/younameit file and applying a search&replace or a keyboard macro to it. I think my machines are slow enough (and my Emacs has enough extra sluggishness thanks to the many assertion checking compiled into it) that I'd be better served with an approach like that of so-long where large files use a dumbed down major mode to avoid most source of extra slow down like font-lock. What I'm not sure of is how useful is a "font-lock with arbitrary narrowing", where portions will be highlighted as strings rather than code (and vice-versa). I don't have enough experience with it yet to be sure. Taking a step back, I suspect that the only "real" solution is something like `jit-lock-defer` coupled with a way to perform the font-lock (and syntax-ppss/propertize) in the background. Stefan