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: Wed, 10 Aug 2022 04:04:33 +0300 Message-ID: References: <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <8c7321f2f36494299e61@heytings.org> <83v8rc2n1h.fsf@gnu.org> <64084296-1953-8ef8-5938-adfb6fb9b43f@yandex.ru> <83r11uzs8n.fsf@gnu.org> <14845631-c2ef-8371-8606-c858092e3192@yandex.ru> <83mtcizov2.fsf@gnu.org> <83h72qzheq.fsf@gnu.org> <25717d84-3411-a93a-3620-e04fe0571aff@yandex.ru> <83edxuzemr.fsf@gnu.org> <83a68hzz0a.fsf@gnu.org> <6ae35c93062c589b2e02@heytings.org> <7b7fbad7-55ac-49b8-840f-7f89a7e8771a@yandex.ru> <6ae35c93064b3588974c@heytings.org> <6ae35c9306c515f420d8@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="17466"; 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 , monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 10 03:05:26 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 1oLaA1-0004OX-KV for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 03:05:25 +0200 Original-Received: from localhost ([::1]:40768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLa9z-0006MU-Tp for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 21:05:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLa9e-0006MB-9p for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 21:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLa9d-0006Zj-Sc for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 21:05:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLa9d-0000F3-L1 for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 21:05: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: Wed, 10 Aug 2022 01:05: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.1660093487906 (code B ref 56682); Wed, 10 Aug 2022 01:05:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 10 Aug 2022 01:04:47 +0000 Original-Received: from localhost ([127.0.0.1]:45552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLa9O-0000EY-TT for submit@debbugs.gnu.org; Tue, 09 Aug 2022 21:04:47 -0400 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:44968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLa9J-0000EG-WE for 56682@debbugs.gnu.org; Tue, 09 Aug 2022 21:04:45 -0400 Original-Received: by mail-wr1-f49.google.com with SMTP id q30so16043909wra.11 for <56682@debbugs.gnu.org>; Tue, 09 Aug 2022 18:04:41 -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=U6WRSAptS7ulnzL80Nejh6NmBNBct2wGbmPl6Mc0egE=; b=Ne1Jt3pPOAcyxxgC8n63IpwDtoUiKFDpgBYrGCpE9/ZOnxyHijF2MNI5O5hKie2VJI dV7xHKWX2Qu/u2vh2ph1jz996HJ9EwCVsMPQb/qxUcVMwXnLfFzGHZPzFbmkK0irBMbw N/4YZvq/uwGmFwsN3IMd9u3ONjPvxNQU0cDr6c8mq8MGcJFx0LCPzVoqIvmzpMXVCOtx vDx+w0lLCA4GoGctJx5vY5QTRRK7+svIf47SBmryALEFQloJXRNvLrXhdYdB7vnS+eZv diQAIj2V3rXUFVaTW/a1MhHn2aeYG54uG0herB5PxHvD/TDJ0Ck5+6yx5J3SgIKplx+t YvXg== 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=U6WRSAptS7ulnzL80Nejh6NmBNBct2wGbmPl6Mc0egE=; b=RHH/dAd9iWAiICJAQIewlQiFfAyBqbk9B41n5B60jLjOEOLmMd10Tvn+jmdEM3lpCY Wx/Z9RwrtDzSzmLyszXuHjc5rtdYffecDl+FHsbTYfzBtjgv8ewQi2pvTG+QQcccPbsB UzD5kEVojWF9t3Y8KZOvSNVsM8+HXaRnyT7ezlZR/8R8tJHPAZws0OXAhXC4iBmvXEMO ERP9S+xaaAUYK5WkxFpisQrL2LA9zh/Ekz9x8l6s9JclasLHUzNaKOFFTp79RJ8Q5O5Q PW98+vFvjOcPjAZndW6PhukHg7ZNh98GVW1PqvgSqEvz5CM2FVVlmE7wHK2frVcPc3KD PbqA== X-Gm-Message-State: ACgBeo16QoqwjF9IGGu0XtlYg218lp4MQ+b1XjT/3HfbtTONsOyGsfrr mdv3VxbQGzPO1TrahsQh+dE= X-Google-Smtp-Source: AA6agR7VnEaZG4kjRL0Uq9mhJIMFd5k5ns3wxf0YRxGTvhVeOfTyXIaaVj83Aif9OuT9v1haFMUD3Q== X-Received: by 2002:a5d:6e0d:0:b0:21e:72e2:a9da with SMTP id h13-20020a5d6e0d000000b0021e72e2a9damr15351818wrz.169.1660093475843; Tue, 09 Aug 2022 18:04:35 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p3-20020a05600c1d8300b003a50924f1c0sm568003wms.18.2022.08.09.18.04.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Aug 2022 18:04:35 -0700 (PDT) Content-Language: en-US In-Reply-To: <6ae35c9306c515f420d8@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:239235 Archived-At: On 07.08.2022 23:21, Gregory Heytings wrote: > >>> No, isearch is entirely agnostic about font locking. >> >> I wonder where it spends those 2 seconds, then. >> > > The answer is simple: it is not isearch that is slow, it's redisplay > that is slowed down by font locking. Turns out, that was true. Unexpectedly, there was an area near the beginning of that file where a particular matcher (that I have now removed in fcd2d14db1) slowed things down considerably. The effect was such that fontifying a particular screen was about as slow as fontifying the end of the buffer. That might or might not be a general design bug in font-lock with its MATCH-ANCHORED syntax (when a line is long, the "anchored" thing might lose its meaning). isearch looks fast again, you're welcome to try. >>> It's yet another test meant to test Emacs' responsiveness, and it is >>> as "objective" as possible: does Emacs choke or does it not? >> >> It's not a test of font-lock's performance, however. Because it >> compares that to a process that's internal to Emacs as well (moving >> across the buffer with C-v). Like, the faster we're able to make the >> latter command, the faster font-lock has to be to keep up. As an >> objective test, it's not meaningful. >> > > It is not by itself a test of font locking performance.  It becomes one > when you compare it with what you see (a) when font locking is > completely disabled, and (b) when font locking is enabled by constrained > by a locked narrowing. What do you get from that comparison? That one thing is faster than the other? That accurate font-lock might take a little more time? In any case, when I floor 'C-v' in dictionary.json now, whether narrowing is applied in 'handle_fontified_prop' or not, I see the buffer stutter around 2%, then go on and freeze around the 9% mark. When I release 'C-v' after waiting a while, it ends up at 12% or 14%. Or if I go to EOB and floor 'M-v', both versions freeze almost right away. So it doesn't look like one is an order of a magnitude faster than the other, or at least not anymore. C-n and C-p are also pretty sluggish with both versions.