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, 02 Aug 2022 18:46:52 +0300 Message-ID: <8335ee7imr.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> <83v8rf5894.fsf@gnu.org> <65cb7c73fd4a999cca00@heytings.org> <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <6ea376f6-d503-06d8-6d83-50c52b695394@yandex.ru> <8c7321f2f3ac52bfee4b@heytings.org> <2f7eeea3-6ba9-d2c2-1fb9-dd40d2de2002@yandex.ru> <8c7321f2f368e8dd096d@heytings.org> <83tu6w2mrm.fsf@gnu.org> <83les82jz1.fsf@gnu.org> <83fsig2ja2.fsf@gnu.org> <83mtcn1isf.fsf@gnu.org> <83b48a42-671a-98d0-da05-1804787db8c8@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36528"; 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 02 17:48:40 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 1oIu8O-0009KQ-2O for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 17:48:40 +0200 Original-Received: from localhost ([::1]:60116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIu8M-0002U8-WD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 11:48:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIu7o-0002TC-HW for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 11:48:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIu7m-0000Q9-Ex for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 11:48:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIu7m-0001qe-Bo for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 11:48: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, 02 Aug 2022 15:48: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.16594552306931 (code B ref 56682); Tue, 02 Aug 2022 15:48:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 2 Aug 2022 15:47:10 +0000 Original-Received: from localhost ([127.0.0.1]:44855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIu6w-0001nj-0A for submit@debbugs.gnu.org; Tue, 02 Aug 2022 11:47:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIu6u-0001nX-7Q for 56682@debbugs.gnu.org; Tue, 02 Aug 2022 11:47:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIu6o-0000IZ-59; Tue, 02 Aug 2022 11:47:02 -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=/foayq8GQ6DHSn+vvE+LP4W+2B24ISZEdAu2aQAQbvw=; b=HQhFR+osryxb aDV7DhyhKG0mdIowz+oKMljT7b9jfZSjfNcQLegtgDvjtD2BeC83qGVphoWHz8HNO2bXR1ZfJzes8 iGvo0dYdz8gcfR3yGAz7Ty3y/Z2XSBv1U0aG3C3O7oyHVuUaSlBh3bnSdjidnGg4JkKEdDCUlLv+P O9l0+GhgPK82ix3fjWYLm2Z4V2cMws/aLPU2Mh8E56lCGex92+hUrStLFz7RhrBpCUjK1C8eYrY4n CiBCCk0jwyssdl3QYmSU10Kp+l5Vqm/26EK91xELRJrkyZJwiWTirxRMD8W5/MCWNcaEqjJPF8Sj/ Rm4G8/dxxd+/YIMuBJAB2w==; Original-Received: from [87.69.77.57] (port=4767 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 1oIu6n-0007Qs-JV; Tue, 02 Aug 2022 11:47:01 -0400 In-Reply-To: <83b48a42-671a-98d0-da05-1804787db8c8@yandex.ru> (message from Dmitry Gutov on Tue, 2 Aug 2022 17:10:53 +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:238568 Archived-At: > Date: Tue, 2 Aug 2022 17:10:53 +0300 > Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca > From: Dmitry Gutov > > On 02.08.2022 05:27, Eli Zaretskii wrote: > >> syntax-ppss cache is a list of checkpoints spread along the buffer. > >> > >> After a modification, only the checkpoints below it are invalidated (to > >> be recomputed on-demand later). > > So a suitably-concocted replace command will still invalidate a lot of > > that cache, right? > > For any cache, one can invent an operation that would result in > thrashing it repeatedly. Yes, but when thrashing causes delays of dozens of seconds, the result is not just a rare delay, the result is simply unacceptable. > A regular search-replace should work well enough, though. Because when > the buffer is long, the user is likely, on average, to spend a lot more > time examining the occurrences and deciding whether to replace each one. > And since the operation goes from top to bottom, this will likely > invalidate the list of caches once, and then rebuild it from the > beginning (or from wherever the first replacement was). We want every basic operation in such buffers to perform reasonably well. That's the goal of this activity. Because partial solutions that sometimes work we already have: there's so-long-mode, there's longlines.el, and a couple of other trick up our sleeve.