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: Sat, 13 Aug 2022 09:44:04 -0400 Message-ID: References: <92da07bd028e3ede61a6@heytings.org> <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> <92da07bd02941d5537e9@heytings.org> <5308e3b5-a160-17d7-77ee-b1d00acfa20d@yandex.ru> <92da07bd02a6cc861e1a@heytings.org> <837d3lzv8n.fsf@gnu.org> <2c8d6755-cfe2-6559-3fde-3fa30ffb411e@yandex.ru> <83mtcgy44k.fsf@gnu.org> <83k07jx5jn.fsf@gnu.org> <866e510d-a060-7daa-d002-97861d056fa7@yandex.ru> <1144021660321893@iva5-64778ce1ba26.qloud-c.yandex.net> <83mtc8n00z.fsf@gnu.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="33066"; 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.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 13 15:46:45 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 1oMrTQ-0008UA-K0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Aug 2022 15:46:44 +0200 Original-Received: from localhost ([::1]:55148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMrTP-0001vB-8c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Aug 2022 09:46:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMrRn-00015B-L1 for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 09:45:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMrRm-0007G0-Ja for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 09:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMrRm-00071v-E2 for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 09:45: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: Sat, 13 Aug 2022 13:45: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.166039825526953 (code B ref 56682); Sat, 13 Aug 2022 13:45:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 13 Aug 2022 13:44:15 +0000 Original-Received: from localhost ([127.0.0.1]:60103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMrR0-00070f-VI for submit@debbugs.gnu.org; Sat, 13 Aug 2022 09:44:15 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMrQz-00070U-W1 for 56682@debbugs.gnu.org; Sat, 13 Aug 2022 09:44:14 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0CB94100142; Sat, 13 Aug 2022 09:44:08 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 41ED410002A; Sat, 13 Aug 2022 09:44:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1660398246; bh=t/FchVQiJhhSK8bwxstvSplxcyZsx7lvbAmiUe+zduM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=g+gjVXpPRlXvtDSRHleqPYIj9snU2NqakYV6NbFDCyWXsZc+J75+Ll8hMb3nzwpLL o9/XO7redhvlWuC6RwUY14PAfK4qMRqQahbw4hSrDvwylyAevPpxCKmhfcRr4qor1q fjXxZfrxPTUYpChFVdgQNHJBjtMkI5tkKJVzUhlvb4eKw/iFQDJ/ZKCNEJ+QtVI/xk jH4lvFqOY64SCUmIcC9eCUIGB+eH5GXnoB2ISGsOvOjkGWelvHl4LL0rj87a3HBftR IC+sl92tqKTLc9DqKxGaE2ICwC21CVSLwnYyAbM8Uwxh7KjELCXfUtuRrbCC4i/dEi SEJ6n3CE747ug== Original-Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E0E8E120198; Sat, 13 Aug 2022 09:44:05 -0400 (EDT) In-Reply-To: <83mtc8n00z.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Aug 2022 09:13:48 +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:239545 Archived-At: >> But the locked narrowing is applied based on the presence of long-lines >> rather than based on the total size of the buffer. > That's true, but the two are closely related: a buffer with very long > lines tends also to be a large buffer. They are related but I don't think it "closely"-enough to conflate the two: e.g. many large buffers have no long lines (e.g. log files) and as Dmitry mentions the thresholds are quite different (back-of-the-envelope suggests a factor 100 or so). > The solutions for stuff that depends on buffer size will indeed be > different from solutions for stuff that depends on line size. > However, font-lock currently depends on both, Various parts of it depends on only one of the two, tho. > and narrowing solves both, albeit in non-specific ways. And I'm all for it as a blunt-but-effective "fallback", as long as it can be selectively overridden from ELisp. Stefan