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: Sat, 13 Aug 2022 22:12:42 +0300 Message-ID: <4d192159-21bc-07f7-7adc-4908303608b0@yandex.ru> References: <834jyq29o1.fsf@gnu.org> <92da07bd028e3ede61a6@heytings.org> <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> <92da07bd02941d5537e9@heytings.org> <5308e3b5-a160-17d7-77ee-b1d00acfa20d@yandex.ru> <92da07bd02a6cc861e1a@heytings.org> <837d3lzv8n.fsf@gnu.org> <2c8d6755-cfe2-6559-3fde-3fa30ffb411e@yandex.ru> <83mtcgy44k.fsf@gnu.org> <83k07jx5jn.fsf@gnu.org> <866e510d-a060-7daa-d002-97861d056fa7@yandex.ru> <1144021660321893@iva5-64778ce1ba26.qloud-c.yandex.net> <66bbbb9598b42aea3b87@heytings.org> <66bbbb9598e592884ab2@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9768"; 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, Eli Zaretskii , Stefan Monnier To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 13 21:13:13 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 1oMwZN-0002R5-Lt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Aug 2022 21:13:13 +0200 Original-Received: from localhost ([::1]:36424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMwZM-0004Vc-N1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Aug 2022 15:13:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMwZD-0004V1-Pb for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 15:13:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMwZB-0003Vv-Qw for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 15:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMwZB-0001HP-KE for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 15:13: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: Sat, 13 Aug 2022 19:13: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.16604179724903 (code B ref 56682); Sat, 13 Aug 2022 19:13:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 13 Aug 2022 19:12:52 +0000 Original-Received: from localhost ([127.0.0.1]:35119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMwZ2-0001H1-8o for submit@debbugs.gnu.org; Sat, 13 Aug 2022 15:12:52 -0400 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:46719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMwZ0-0001Gp-Fe for 56682@debbugs.gnu.org; Sat, 13 Aug 2022 15:12:50 -0400 Original-Received: by mail-wr1-f49.google.com with SMTP id l4so4499830wrm.13 for <56682@debbugs.gnu.org>; Sat, 13 Aug 2022 12:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc; bh=Qn/gSEFSab3RxwfQzp4Iy5GnN/+dOlAFht8obBW6cuc=; b=I1a3qG0x7F5Z83WO6Z1AFDmDNocDGRRaNtd7oYiVKIaIZjQgt9s/YPeuirSKyap1/y d4AhXhUWUR9NM8al7y2GblB+Vt2VLS1LOh9sHWSoLA5nHF/TRtlrHOozy2biIYEruzWb /IFqnkPtbei7MT7xgI1Kt0dh+gEDzRKh0R18d+wX5TXZwnbybLk37fKgvUhr/mH7KLDX 7+2mcOKAxMiyfDyft2sgZHR84ujdWWFcFVQtrUUhHnZ7L06XXmQtvcERh2JbM+4hmIux gXkzeTP83Sz7isObWn2NkQVeepHDIlIAF6D8Hp2DSgn88uplZQH/L/mvvHyO0aAaMI7j lXtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc; bh=Qn/gSEFSab3RxwfQzp4Iy5GnN/+dOlAFht8obBW6cuc=; b=uYlAegnThdJqBWJdL9BqAkCPbOFmUUg4rCe5fQgWXq4UUK1xBsxHpuJonluZ9Qn3gF rO6fA44lUMsG5q4Pi7oxQKeOB45t9lcZwOqruWoOJ4ThssMlVeT1JkXWGYOxs2VmW1LV W8Of64bsNy3JxbBHmiR3XItnqliGZtn79I6l1kQKOG0j5V/2r0lntA4XabCPkFDaeH+A g06EexH+bgeEI+na/4GLE6pgu2swqxsD08ysHurVLme+50svQX9yV9HKeZN+ZHWehVjF eVHNbF4pIjnjEDi0Hlc6bgZsQ0Oq0OM6hKm7gXeJmtECX84hNHJUPxmr7s1aQN1mVGDH 1ujA== X-Gm-Message-State: ACgBeo1I47PsrqTO8YSljTy+OE9V25ZriK/AIXfXTj7qQ5BevNiAtLW2 5l8llBzGKyKb3ngQYjvNs9o= X-Google-Smtp-Source: AA6agR5LTTD6UXZG8TbHLVHR0Dt+7Rk++ZwIm8i5QpI7FEoiKP6Dt8ZWsexSHnDFT/7/VF+Ft1gqlw== X-Received: by 2002:a05:6000:10b:b0:21f:127d:6e3a with SMTP id o11-20020a056000010b00b0021f127d6e3amr4796311wrx.185.1660417964910; Sat, 13 Aug 2022 12:12:44 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id ba11-20020a0560001c0b00b002235eb9d200sm2715645wrb.10.2022.08.13.12.12.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Aug 2022 12:12:44 -0700 (PDT) Content-Language: en-US In-Reply-To: <66bbbb9598e592884ab2@heytings.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:239587 Archived-At: On 13.08.2022 20:26, Gregory Heytings wrote: > >>> That's what I initially thought, too.  Now I tend to think that it >>> would be better to not decouple these two cases, because it would be >>> too expensive to distinguish the four possible cases, namely: >> >> I'm fairly sure that my branch demonstrates that there's nothing >> expensive about it. >> > > If you think this, it means you do not fully understand the problem, > sorry.  Detecting the presence of long lines in a buffer takes time, and > it takes more time as the buffer becomes larger. How is that relevant? font-lock's performance does not depend on the presence of long lines. >> It's just one commit, 20 additions, 10 deletions. It should take 2 >> minutes max to read and understand it. >> > > As I said, I tested that commit.  And I understood it, too.  What you do > there does not even depend on the presence of long lines in the buffer > (or on the length of the buffer). Exactly. > Moreover it does not offer any > protection against modes which use widen in their font locking > routines.  Which was the main reason to add the locked narrowing feature. The only modes we know that do that (CC Mode) are also incompatible with your code. Your "protection" breaks it. And when CC Mode is fixed to work inside a narrowing, it will automatically become compatible with my proposal.