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: Wed, 27 Jul 2022 14:18:01 +0300 Message-ID: <83pmhqby8m.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35003"; 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 Wed Jul 27 13:19:30 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 1oGf4a-0008uF-VI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 13:19:29 +0200 Original-Received: from localhost ([::1]:48486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGf4Z-0007h2-J7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jul 2022 07:19:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGf4H-0007gs-SF for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 07:19:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGf4A-0005If-Gx for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 07:19:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGf4A-00045O-7e for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2022 07:19: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: Wed, 27 Jul 2022 11:19: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.165892069015633 (code B ref 56682); Wed, 27 Jul 2022 11:19:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 27 Jul 2022 11:18:10 +0000 Original-Received: from localhost ([127.0.0.1]:55279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGf3K-000445-Dv for submit@debbugs.gnu.org; Wed, 27 Jul 2022 07:18:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGf3H-00043b-9N for 56682@debbugs.gnu.org; Wed, 27 Jul 2022 07:18:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGf3A-0005CD-VX; Wed, 27 Jul 2022 07:18:00 -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=xguLXSs7XW09lBnru/DIy8M48tE0SpqImruHmVT0CN0=; b=GSaX9sz0O/3z I3yOtVRBhv2515s37OmkHAA/uGXuEd3c5MQxqOMH3isXglySrFDB4qeIcnqjh78BhqPf0a2KWgALL E+vcWU5MRmlgETTUi+rIQG8kcFHozwX47MIDusGZMzdxA49e9UtF6D6Svdg/DlHINphbYJrHsWm27 vOzo/IBS5r7omBp/ub2DrI9lIW0+kgYp/c9F46W9zTPvft8w5/AggEFuhpK94NClkUfyb4BjnJi4I qf3B7/RB8mD5/wTMNum1ENV1EzmK32W0oFpIP24CUGMQhPHEKfGIZeoI2/2wrbTXtg4XX7XzKdzzj qYrD2zhW7+uF2eVlY+0zaw==; Original-Received: from [87.69.77.57] (port=2074 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 1oGf35-00072R-5R; Wed, 27 Jul 2022 07:18:00 -0400 In-Reply-To: (message from Stefan Monnier on Tue, 26 Jul 2022 17:17: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:238025 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 56682@debbugs.gnu.org > Date: Tue, 26 Jul 2022 17:17:29 -0400 > > > Allowing fontification-functions to search for arbitrarily complex > > regexpes in an arbitrarily large buffer, each and every time they are > > asked to to highlight a small chunk of the said buffer, is a recipe > > for disaster. > > `font-lock.el` could enforce a smaller scope in a more discerning way > that narrowing can. > > > If for some reason modes really need to go through to the whole > > buffer to decide which highlighting to use, they should to do so outside of > > fontification-functions, and ideally once, for example, when the file > > is loaded. > > With the current narrowing they can't even know why the buffer is > narrowed and hence can't make an informed decision whether they should > maybe widen to look elsewhere. 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.