From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Tue, 2 Aug 2022 17:10:53 +0300 Message-ID: <83b48a42-671a-98d0-da05-1804787db8c8@yandex.ru> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33971"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 02 16:12:23 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 1oIsdD-0008jz-U9 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 16:12:23 +0200 Original-Received: from localhost ([::1]:39704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIsdC-0008Fu-Vr for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 10:12:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIsct-0008EN-Vh for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 10:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIscr-0005nY-U6 for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 10:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIscr-0007ep-N7 for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 10:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Aug 2022 14:12: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.165944946329366 (code B ref 56682); Tue, 02 Aug 2022 14:12:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 2 Aug 2022 14:11:03 +0000 Original-Received: from localhost ([127.0.0.1]:44633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIsbu-0007da-OE for submit@debbugs.gnu.org; Tue, 02 Aug 2022 10:11:02 -0400 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:34611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIsbt-0007d5-B5 for 56682@debbugs.gnu.org; Tue, 02 Aug 2022 10:11:01 -0400 Original-Received: by mail-wr1-f49.google.com with SMTP id j1so9684140wrw.1 for <56682@debbugs.gnu.org>; Tue, 02 Aug 2022 07:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=0MiK2rTvM6HaFWt8dKvnC6M0o0kXmFUBhstQWidKCJI=; b=qy7VsUwBQuPCj+QbqmIs2tRdQHP7DCFCGzloiyzBhZzo1W4gN41/lA7BMyReVMCZhK n6VW3HoU9//Sm2dyS81saVKIgtXzgDA8+ueIrPCehYsA/1wqCq6eYRU9eOvkCP65UokM wt54DLTPUFbrIfzttmnbaAe/cw3zPSvXJladA0mQNFjmxf23hJwyTL+eH0aBasfi9Jmo zixLbXoV5OWOh6yfxmtCCv7GuXhdnrnGVrsYskZUShJa/7DWX5xoqr3NTdv0GptfxZwQ QImNK8Ovhll/8qB5FOGgr3Ng7UPZeKOfYKQENn84XIye7/Foan4f3x23AU1W5iqQn6qg 3Fqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=0MiK2rTvM6HaFWt8dKvnC6M0o0kXmFUBhstQWidKCJI=; b=06776OPhFb/A1wQK68f5ZGqbfKOrptO/jDOnWf/xAcbzFxZG0MPiNgOGugKwDoBrnc yT4WFNbpvHqQXZx9vMcwjN3n/sqzOeJxRzhHCUd6AS766aB4MeetqZvfSHzxLg8K16QZ ZBLjbzuZvX9noMxreJbFdwDVpcqboHB9SeEOHxGCeoBCF9KqN9XhdEsz/ETbdjPh1DEe fW9ETuxTrY5yDs/LwNJshgJSG09JQQ1/coc2cLL/cHlEjL8UHrne3ttvnWFiwgmeLIm9 pafUYZUCMhe+feXAqw9K8S1cJhOjY2RefkEiZiNmIm9m6JgoHblRX0wmUW/dFj2d3/6r v2lw== X-Gm-Message-State: ACgBeo1NUfJL7ckCXpRNmL1cP3b5vWdFYLsAqrciF7m730dnV2bsir1w D0SGrkNWIHWnSv8QIMkc5ew= X-Google-Smtp-Source: AA6agR5D0GuCGdlb0deJQIIFW7FPANyvmVcZENdsIqS6BT1gSi2tWUJV/Oe0Hwhs/jtCzmsFyAmZwA== X-Received: by 2002:adf:e6d0:0:b0:21f:156d:1a8c with SMTP id y16-20020adfe6d0000000b0021f156d1a8cmr12123732wrm.177.1659449455741; Tue, 02 Aug 2022 07:10:55 -0700 (PDT) Original-Received: from [192.168.0.215] (buscust41-118.static.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id v25-20020a5d5919000000b0021d69860b66sm17903176wrd.9.2022.08.02.07.10.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Aug 2022 07:10:55 -0700 (PDT) Content-Language: en-US In-Reply-To: <83mtcn1isf.fsf@gnu.org> 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:238554 Archived-At: 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. 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).