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: Sat, 30 Jul 2022 11:12:39 +0300 Message-ID: <83v8rf5894.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 30 10:13:14 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 1oHhay-0003E4-0f for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 10:13:12 +0200 Original-Received: from localhost ([::1]:34870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHhax-0007SL-4O for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jul 2022 04:13:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHhao-0007S5-Mz for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 04:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHhao-0007Uy-Ct for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 04:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHhao-00057c-8z for bug-gnu-emacs@gnu.org; Sat, 30 Jul 2022 04:13: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: Sat, 30 Jul 2022 08:13: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.165916877419674 (code B ref 56682); Sat, 30 Jul 2022 08:13:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 30 Jul 2022 08:12:54 +0000 Original-Received: from localhost ([127.0.0.1]:33970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHhaf-00057G-QF for submit@debbugs.gnu.org; Sat, 30 Jul 2022 04:12:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHhaa-000570-Q9 for 56682@debbugs.gnu.org; Sat, 30 Jul 2022 04:12:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:32900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHhaV-0007Tm-HN; Sat, 30 Jul 2022 04:12:43 -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=KWF1JjBXWHK4GxsYNCxqUiMps66+zx/18aXO68USAGE=; b=gw12HNDj1GKi W4yrslM5NDrHK9rI+rK3j0Um02ofiXENZpVwODPjeo0z5ubJ0CivBJPfGo98BpYhwqDuYPpFcK+cW GZ3B57gSrf5j5QL5rwKcF35310PuGTSRJi3g6/eyv5LIkC8IoTB6NxOmcqv+vzZXHf0zHi95nuAD0 uExhVJMPpztIG3QFI/cwzlbK9K22p0u/i25w/cTl06fGwlnI3mClO88OljH15KwKxpgXV8mhuPOPh QxZKVq/gBVkAB9NMtmCIjMSOPvOZ41a5k3GLbr29Ors0hb6+56IL9tcwg136GbaIwOBvrkL/aDJ5i U+9jShmOjfN12uCNj65Dpg==; Original-Received: from [87.69.77.57] (port=1718 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 1oHhaV-0000lF-0j; Sat, 30 Jul 2022 04:12:43 -0400 In-Reply-To: (message from Stefan Monnier on Sat, 30 Jul 2022 03:16:29 -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:238240 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 56682@debbugs.gnu.org > Date: Sat, 30 Jul 2022 03:16:29 -0400 > > > Feel free to suggest better ways of handling these issues, or even > > ways to solve this entirely inside font-lock. If and when such > > suggestions materialize, I'm sure we will be glad to use them instead > > of less elegant/more direct solutions. > > I'd suggest to keep things mostly as they are but move the decision to > ELisp: i.e. pass the beg..end limits to jit-lock and let jit-lock do > the narrowing. This way it's easy to later refine the mechanism. That's already happening: code called via fontification-functions can access the restriction via point-min and point-max. If you or someone else can come up with efficient methods of using that information so as not to go too far forward and back, we could consider removing the lock from the narrowing. But we'd need to see the code first and assess the resulting performance with long lines.