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, 16 Aug 2022 17:00:18 +0300 Message-ID: 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> <83v8qvj79c.fsf@gnu.org> <838rnqk8op.fsf@gnu.org> <83v8qtha89.fsf@gnu.org> <859945d6-87a6-d0d2-e693-8ebe21c328fd@yandex.ru> <83sflxh5c1.fsf@gnu.org> <6a72b305-ec92-8449-7a11-b006caadb707@yandex.ru> <83o7wlh2as.fsf@gnu.org> <52e0d4d6-f022-ffdf-8325-c4d1762b47a2@yandex.ru> <83a684hq8f.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="10025"; 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 16 16:01:27 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 1oNx8J-0002T4-AH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 16:01:27 +0200 Original-Received: from localhost ([::1]:41280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNx8I-0008OG-8c for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 10:01:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNx7u-0008O0-JY for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 10:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNx7u-0000Kh-AX for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 10:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNx7u-0004wg-4s for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 10:01:02 -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, 16 Aug 2022 14:01: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.166065842918943 (code B ref 56682); Tue, 16 Aug 2022 14:01:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 16 Aug 2022 14:00:29 +0000 Original-Received: from localhost ([127.0.0.1]:47883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNx7N-0004vT-5E for submit@debbugs.gnu.org; Tue, 16 Aug 2022 10:00:29 -0400 Original-Received: from mail-wr1-f42.google.com ([209.85.221.42]:37646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNx7K-0004v5-LB for 56682@debbugs.gnu.org; Tue, 16 Aug 2022 10:00:27 -0400 Original-Received: by mail-wr1-f42.google.com with SMTP id n7so1540307wrv.4 for <56682@debbugs.gnu.org>; Tue, 16 Aug 2022 07:00:26 -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=yEJ0ehwbIQb9J9GkVw0DbdqpsWzUwpHPJdlVy3nvOl8=; b=CoMKkls7Tgaj4wRsXszv27VDiywElWRxwl4TO2eucihqzwBRsKsOH1FsiRSmK/Re2g ZppNlWEqrxWtXCtn4bSDiYC33TFeCOlW6TjQbcxdjbfJM8iAlwbyZ6WN56kEjljTe/bP UZFlXGnM5MRPYyoFUIQs6fx8L1Z+iBF5VTAdqtDQFYJPCMjybt0SYhge5JncdEnA3Psr 9IcucVT9nBqy23u8eeB8l8Se5wVCqCv3xFN2aNrXW42eExPW/E/3nJsmGgVnXqKpqOe7 tMnyeaENpJ224clXplZllnTgqLgBuP0uP5lvTzwtX+PUgzWypgMieGOkzxIoew6kHkjJ 6few== 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=yEJ0ehwbIQb9J9GkVw0DbdqpsWzUwpHPJdlVy3nvOl8=; b=QtpwlLlFUhkpUSjXvX618Wo52Jl57tcNd5IN7IFOAxfRCLoH2SRIWNEdxKGTkD9Qmb 1Z2YDBQL5BBnDyiwR6zWiE0/XbnIEDULGgrMKIonCBjARuZSNfAvc1TLZt1+H0OMSOlr 8/0AoOm68x67XKvNg343g7pLBWwkvINcUmhPI3hhvfgUtR5IRgTvMkCMmEcAhJDuclF2 waXNa/IJ4YaEUmRU15zemQpdJ8MQFHiS5V7RAkrW32pIJgnDFjrLplHE1UBgLm2S/CGB hlJ1kYfkp6StFiKjgAGX2Awnb14RRnPui6LJXNfUajnE4Js8zOAymXsYMgP0AxZcN5dS rPaA== X-Gm-Message-State: ACgBeo2XTVteK9hTKFWfAN0WQxtneGu8QStr5f7zRWEi7K+VYL1SLi8n sh/u9oJI+qg+hsHCyLgmspA= X-Google-Smtp-Source: AA6agR4LKRJNPw29EdGjwBfP17Yp522N+dhSAemiwiY3ek64au02xaun/xgiywfFXQYfTaEkEs0hzA== X-Received: by 2002:adf:f9cf:0:b0:225:10bb:28ed with SMTP id w15-20020adff9cf000000b0022510bb28edmr3214868wrr.370.1660658421038; Tue, 16 Aug 2022 07:00:21 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id az15-20020adfe18f000000b0021dd08ad8d7sm10780231wrb.46.2022.08.16.07.00.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Aug 2022 07:00:20 -0700 (PDT) Content-Language: en-US In-Reply-To: <83a684hq8f.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:239946 Archived-At: On 16.08.2022 05:33, Eli Zaretskii wrote: >> Date: Mon, 15 Aug 2022 22:51:16 +0300 >> Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca >> From: Dmitry Gutov >> >> On 15.08.2022 19:58, Eli Zaretskii wrote: >>>> Date: Mon, 15 Aug 2022 19:44:07 +0300 >>>> Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca >>>> From: Dmitry Gutov >>>> >>>>>> Here's the profiler output anyway: >>>>>> >>>>>> 1067 85% - command-execute >>>>>> 1067 85% - call-interactively >>>>>> 1023 82% - funcall-interactively >>>>>> 1012 81% - end-of-buffer >>>>>> 1008 81% - recenter >>>>>> 1008 81% - jit-lock-function >>>>> When did you last resync from Git? 'recenter' got "optimized" >>>>> yesterday for buffers with long lines. >>>> >>>> Just today. >>>> >>>> In any case, it doesn't look like recenter's problem, since the output >>>> says all (or vast majority) of its time is spent in jit-lock-function. >>> >>> AFAIU 'recenter' shouldn't at all call jit-lock-function in a buffer >>> with long lines. Is this "emacs -Q" without any changes from >>> defaults? >> >> It's a buffer without long lines. Simply a large file. > > ??? Are we talking about long-line.xml, or are we talking about > some other file? We did nothing to change the behavior in large files > without long lines. I'm talking about a 20 MB file I created manually with some simple contents. Just no long lines. long-line.xml is only 300 KB, but if you query-replace ', you should see the same delay that I'm talking about, on master. The conditions seem to be: no long lines, file size > 20MB. The profiler output looks the same. > If you are saying that 'recenter' takes too long in some file, and > therefore delays M-> for too long, it is probably a separate issue, so > please report that as a separate bug, preferably with the file that > causes it. It seems pertinent to me since ultimately the decision to narrow in handle_fontified_prop is driven by the idea that font-lock in large files ends up being a problem anyway. And here we have a large file where this doesn't help. But I can file it separately, of course.