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: Mon, 1 Aug 2022 04:23:21 +0300 Message-ID: <56a688f6-6c93-8b67-895c-2c41f563fc93@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> 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="12660"; 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 Mon Aug 01 03:24:11 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 1oIKAE-0003B0-8j for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 03:24:10 +0200 Original-Received: from localhost ([::1]:43864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIKAD-0001c6-3o for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jul 2022 21:24:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIKA6-0001bx-1i for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 21:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIKA5-0007qW-Pb for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 21:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIKA5-0003PJ-LD for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 21:24: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: Mon, 01 Aug 2022 01:24: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.165931701413064 (code B ref 56682); Mon, 01 Aug 2022 01:24:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 1 Aug 2022 01:23:34 +0000 Original-Received: from localhost ([127.0.0.1]:38873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIK9d-0003Od-Sx for submit@debbugs.gnu.org; Sun, 31 Jul 2022 21:23:34 -0400 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:33568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIK9a-0003OO-7i for 56682@debbugs.gnu.org; Sun, 31 Jul 2022 21:23:32 -0400 Original-Received: by mail-wr1-f50.google.com with SMTP id v3so11378268wrp.0 for <56682@debbugs.gnu.org>; Sun, 31 Jul 2022 18:23:30 -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=mjuxmBJINdbP4ttghZaBRKO6F5jHlwzXhneUWqYTMhA=; b=h8b2apk/cSeX5i0n5pid8UYxWOjeDEg3IMkyFCXOB3rxXqaPwQpaWssYM2PO/ZHoFn Pko1BuTHQWUR7K1dvRBtWtGib4SKKQCDuo9zJ+NvErag4flnqN4gh6VjlPbBdpfhMaRz uBIhCL9tlOVcmbJaKBmSxxjIqdiBv/MmBOAnD/pI+XXeTKav+8jjrixkR4oY1jdLo70D B3hMho56TGQwhzlQ4nkaW/aaj38WiEF7xt3kCNWrmO5Ta0CuS8zYxjk/9U2CUH/2AqyV 8d/mmcEiojhr2mbpNB7dG80zNtJUBrjjMXGZb32tqFADg37CCxdWdZk7mE8bf3pYerNX G1Mg== 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=mjuxmBJINdbP4ttghZaBRKO6F5jHlwzXhneUWqYTMhA=; b=TLNrw9DAKkHShhus3LnHk2MQX5ERbzNW2/IMvB265oSLwS6LQhg12u2KPc/S6K/T5G TSmCN6hV7gqAHf5ROGOhMQJb2iyJtXrMUIANANo5YzW1COGzahk0NXJrtxejynwxhZr6 Ue8CvHyGsiS1KSP4NmS5+6bKMeU5DxqhAd7u+s875u2RnF4DUxPLirYU2R7cuFwwosT9 Lmea1pB1zNWR5pmCqzRZmxdOyQ136dVTQ272zYlORm/bCClV9YpmClgTtKZLyXA7PzY+ EwY9Uf1N6OGHKRMK+45682by6HBp5TyoRhowODroqtAsdAA3EIVXAUcm+xOkCthMhVT5 5Y8g== X-Gm-Message-State: ACgBeo1XWaOO8b0awrBpUmEAPDW4wKp2C4hGnI5xjdrXiiZHWr3Yx6fU XMB1c87Zj2FQ4WxDH7FaBZc= X-Google-Smtp-Source: AA6agR6HYQWxmYmAliwyEUsyr7vut/bfqRShW8vWa9bAVj+7iFJQcvdOBRP/h0w4bkz011Uoa0h+1w== X-Received: by 2002:a5d:6608:0:b0:220:625e:f4e1 with SMTP id n8-20020a5d6608000000b00220625ef4e1mr2288164wru.252.1659317004386; Sun, 31 Jul 2022 18:23:24 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id m28-20020a05600c3b1c00b003a31ba538c2sm13304963wms.40.2022.07.31.18.23.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 Jul 2022 18:23:23 -0700 (PDT) Content-Language: en-US In-Reply-To: <8c7321f2f368e8dd096d@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:238382 Archived-At: On 01.08.2022 01:50, Gregory Heytings wrote: > >> >> But one big slow scan (and how slow it is actually depends on a >> particular major mode) followed by responsive editing sounds much >> better than what we've had before. >> > > Indeed.  But then the question is: is it possible to do that scan while > opening the file, before it becomes editable? IIUC this state of affairs is caused by your chosen approach to speeding up font-lock (hard narrowing while it is called), which makes the initial call to syntax-ppss happen inside that narrowing as well. The alternative being that font-lock would call syntax-ppss right away with no restriction, but then only apply highlighting to limited parts of the buffer. > It is way better to wait > a few seconds more while the file is being opened than to wait before > two basic motion commands when the file is already opened. I agree, yes. >> So I would recommend against trying to solve this part right now. >> > > It doesn't only solve the syntax-ppss problem, it also makes > flyspell-mode usable in such files, for example. Does flyspell-mode always scan the full buffer?