From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Fri, 05 Aug 2022 13:57:19 +0300 Message-ID: <83bksz0xgw.fsf@gnu.org> References: <8c7321f2f3ac52bfee4b@heytings.org> <8c7321f2f3ec1ef81af9@heytings.org> <02e83b0e-1b5c-fe75-6e59-1f8ddff82d37@yandex.ru> <96f28fd8-6744-1925-0631-0095099362dd@yandex.ru> <74ddc877f1b74ab56d18@heytings.org> <83r11y5a9d.fsf@gnu.org> <83h72t5y2d.fsf@gnu.org> <83pmhg4le6.fsf@gnu.org> <83r11v1a9w.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28474"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, dgutov@yandex.ru To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 05 12:58:54 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 1oJv2c-0007GA-4l for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 12:58:54 +0200 Original-Received: from localhost ([::1]:57756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJv2b-00059b-3A for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 06:58:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJv1m-00056y-5R for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 06:58:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJv1l-0005vd-RQ for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 06:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJv1l-0001jl-M3 for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 06:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Aug 2022 10:58: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.16596970526638 (code B ref 56682); Fri, 05 Aug 2022 10:58:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 5 Aug 2022 10:57:32 +0000 Original-Received: from localhost ([127.0.0.1]:56360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJv1I-0001j0-GU for submit@debbugs.gnu.org; Fri, 05 Aug 2022 06:57:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJv1H-0001io-AO for 56682@debbugs.gnu.org; Fri, 05 Aug 2022 06:57:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJv17-0005qU-NH; Fri, 05 Aug 2022 06:57:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VAJiqxlDMplLCc690jp5OyHDNkHlIzuVjFtZUsp8kvE=; b=U1YFdxoYm8pu 6t7dAGmJDh3r150adsoH0H/ffC32MhtmVIiWF46j1yQXVInGEncBzI2UiJ90psRMMutB5pslH60+b HjhWdV3KWKvv2gewOKePSCpjqkO7eRXBClbUnmlrG1bp+WYMyRMXz03YrlEJ0DbEExdOYUUldGF/5 b54G/9Ne/qR97oEhSzS0Vtu3tSnyqZT/bxV91W2P8hHjXD1gZfcbrU2qXxB3nY/YgmC23pDvJOagK IOkXAXu6Tw1HzjiXOxw1AOkKIljYYnpHeEQUezwsfPPjqpQVegRwpBwIZTyu3AMhh3/sRtc/6ZzsR 48RnCaWFect+e/oj7l8s+Q==; Original-Received: from [87.69.77.57] (port=1644 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJv17-00013H-10; Fri, 05 Aug 2022 06:57:21 -0400 In-Reply-To: (message from Stefan Monnier on Fri, 05 Aug 2022 05:03:25 -0400) 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:238858 Archived-At: > From: Stefan Monnier > Cc: gregory@heytings.org, dgutov@yandex.ru, 56682@debbugs.gnu.org > Date: Fri, 05 Aug 2022 05:03:25 -0400 > > >> The use of `syntax-wholeline-max` in > >> `font-lock-extend-region-wholelines` supposedly fixed this problem since > >> it changed `font-lock` so it doesn't ask `syntax-ppss` to compute the > >> whole line/buffer. > > > > It did? > > And if it did, how is that better or different from a locked > > narrowing? > > In terms of end-user behavior, it's very similar: it can break the > `font-lock-keywords` part of font-lock but it still lets `syntax-ppss` > look at the whole buffer and will thus still provide correct recognition > of strings and comments, except when the major mode relies on > `syntax-propertize-function` since that one also obeys > `syntax-wholeline-max` and can thus misbehave in a similar way to the > narrowing. > > The more important difference is that it can be > tweaked/changed/broken/improved by any ELisp package without > necessitating a recompilation of Emacs's C code, or ugly workarounds to > escape the narrowing, like postponing the actual font-lock to a timer or > some such. AFAIK, the problem is not entirely solved by syntax-wholeline-max. If and when it is solved, we could revisit this issue. However, since syntactic fontifications are invoked by a major-mode's font-lock setup, there's still a problem of how to prevent the rest of font-lock from causing significant slowdown.