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: Tue, 16 Aug 2022 05:45:18 +0300 Message-ID: <837d38hpoh.fsf@gnu.org> References: <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> <12348081660379417@sas2-a098efd00d24.qloud-c.yandex.net> <66bbbb95983414e79637@heytings.org> <83wnb9hadb.fsf@gnu.org> <395454dd-7238-c5d0-e924-2f65a186baa7@yandex.ru> <83r11hh4pm.fsf@gnu.org> <83k079gy4h.fsf@gnu.org> <03742b06-6053-fb75-8873-8d355fd1f71b@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30284"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 16 04:46:10 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 1oNmao-0007is-3a for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 04:46:10 +0200 Original-Received: from localhost ([::1]:52204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNmam-0004Rh-GD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 22:46:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNmag-0004RY-RI for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 22:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNmag-0005RY-J5 for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 22:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNmag-00076Q-7y for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 22:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Aug 2022 02:46: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.166061794327275 (code B ref 56682); Tue, 16 Aug 2022 02:46:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 16 Aug 2022 02:45:43 +0000 Original-Received: from localhost ([127.0.0.1]:44445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNmaM-00075r-TG for submit@debbugs.gnu.org; Mon, 15 Aug 2022 22:45:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNmaH-00075c-Np for 56682@debbugs.gnu.org; Mon, 15 Aug 2022 22:45:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNmaB-0005JM-CJ; Mon, 15 Aug 2022 22:45:31 -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=3mnaq4yv/CkXsRUGUXYplAKyxX4am1laoV6SK8/t9Xg=; b=ZZTOIq9ZrNj6 G0+dI8JzWhMKhKUrbFr2qt9pONYBIFvrVrc5dYU9lzbCYLW2sGRjf3wtYH7bjbKmC46phprLFMuf3 p3UT2+xlxc+q39iOZlxyM85L2i9YvDVhCIxcrRIOSN/+e/0kEDOqgFV+LhODkkQi1l4rcC7SpQOPt gs1OXV4FkfyEZKjU7kjEGZhgAlPO9K1St+QaPdPdNsM4HXCwV94dE6CIDOhGfg0Bom1i+iWigxUl+ OJJG6VSGr1w3tPyWB5mlBMreOnj8CQ1NBZjnlnFOP6EOEGU9hMPu+6ie/ossCTqWMoBt+Mb3jv/+z GYO+ocDzbMyS8xtHXiU4mQ==; Original-Received: from [87.69.77.57] (port=3219 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 1oNmaA-000248-SE; Mon, 15 Aug 2022 22:45:31 -0400 In-Reply-To: <03742b06-6053-fb75-8873-8d355fd1f71b@yandex.ru> (message from Dmitry Gutov on Tue, 16 Aug 2022 00:18: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:239864 Archived-At: > Date: Tue, 16 Aug 2022 00:18:35 +0300 > Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca > From: Dmitry Gutov > > >> It should also be possible to move the whole invocation of the > >> fontification-functions up to Lisp > > > > How do you do that, given that these functions should be called from > > redisplay with the region of buffer text only redisplay knows about? > > Something like in the attached patch. I fail to see the difference which would justify such a change. > If we apply narrowing in handle_fontified_prop (or like in the > attachment), and also in font-lock-fontify-region, it seems like every > significant (*) execution path will go through two repetitions of the > same logic. > > That's not ideal. But not a catastrophe, either. > >> And nlinum might not appreciate being narrowed. It seems to be working > >> okay without that in my 20 MB XML file. And in 200 MB one too. > > > > Why is it important what nlinum does, when we have native line numbers > > nowadays? > > Just an example of a mode which uses jit-lock-functions. With an > implication that other, less known modes, might have similar needs and > behavior. There aren't too many known examples. Let's hear them hollering, and then see what are their problems.