From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Tue, 16 Aug 2022 10:24:18 +0000 Message-ID: <325f95fd2bdd2289114b@heytings.org> References: <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> <83wnbckp0q.fsf@gnu.org> <8e884ebe-2d2e-d599-15c3-a5cfe5e6b295@yandex.ru> <83o7wnl7ok.fsf@gnu.org> <036414cc-c711-efaf-ed5b-f8ccfaca0604@yandex.ru> <5900f20836753183a6ac@heytings.org> <5c22e38a-5dcd-860e-28a0-b4a5ede6a21b@yandex.ru> <877d3awb92.fsf@localhost> <87pmh2z277.fsf@localhost> <87mtc6yzfv.fsf@localhost> <3a1232a17bf48a4a693e@heytings.org> <87lerp4tk1.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34389"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier , Dmitry Gutov To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 16 12:26:24 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 1oNtmB-0008hg-1w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 12:26:23 +0200 Original-Received: from localhost ([::1]:55120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNtm8-0000SG-0S for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 06:26:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNtks-0000RI-7k for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 06:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNtkr-0006un-QB for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 06:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNtkr-0002ET-LC for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 06:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Aug 2022 10:25: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.16606454638515 (code B ref 56682); Tue, 16 Aug 2022 10:25:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 16 Aug 2022 10:24:23 +0000 Original-Received: from localhost ([127.0.0.1]:44979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNtkE-0002DH-V0 for submit@debbugs.gnu.org; Tue, 16 Aug 2022 06:24:23 -0400 Original-Received: from heytings.org ([95.142.160.155]:55526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNtkC-0002D8-9C for 56682@debbugs.gnu.org; Tue, 16 Aug 2022 06:24:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1660645459; bh=xZLtE88g76RTPPRD6TQ/ictmxU/Y9uvgiruVznsF+A8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=4JaGdZwn+jkml+W/UdUGYQZcW3RyxrDlvKD8oeLfQPEchdX0E8F4/pB6+muVo4dKL rfWTJR02OyWLNBX8ltfSmC0UDqtEBmaDYsilZlbDD57uEVz9l372ZClnvoPAct7zsp xxLUIVexAgKFqmhjN2wPrJqefAHzWaqf203sDdMhI5K/2sm6uDz6EmO1pw+IwQSRz3 zhgUqSMrHgR/X81reIXGs6oA4ws07UZht3L9I7D3dchGirI1eZ25oGXRswSTEvg3AW KsqCF1LemXNS0uiK16kNWT0O1mijaW0xcfJI/4q2ThGWjiu8M4EADKMX8BR46Gw4tw 03GCKbZFJ7rtg== In-Reply-To: <87lerp4tk1.fsf@localhost> 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:239888 Archived-At: >> I'm not sure I correctly understand what you mean, but it seems to me >> that the fact that the Org parser caches its results implies that Org >> doesn't need to access the whole buffer to make "local" decisions. It >> can use the data in cache for everything that is outside of the current >> narrowing, and update the portion of the cache corresponding to the >> current narrowing. IOW, there is no need to maintain separate parser >> caches for each possible narrowing state. Am I misunderstanding >> something? > > Cache existence is not guaranteed. > Can that cache not be created unconditionally when the Org file is opened? > > When cache does not exist, Org must widen. If not, the cache will be > valid only for the current narrowing. > > When cache do exist, Org may not need to widen. But that also mean that > widening has happened in the past when the cache was generated. > > At the end, Org does need to be able to widen safely. At least in some > cases. > That will always be possible. What should better be avoided is to use widen (and to scan the whole buffer) in performance-critical places, such as fontification-functions.