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: Sun, 14 Aug 2022 21:14:00 +0300 Message-ID: <14516fce-8c35-1ce7-1314-44a3d79e8ba7@yandex.ru> References: <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> <12348081660379417@sas2-a098efd00d24.qloud-c.yandex.net> <66bbbb95983414e79637@heytings.org> <66bbbb95983475c5f3b0@heytings.org> <0d67f253-c080-d750-c2cb-4a9591ff8c6c@yandex.ru> <83lerrl734.fsf@gnu.org> <83wnbbj7v4.fsf@gnu.org> <75c316c0-3346-e702-b114-41a7f899deb1@yandex.ru> <5900f20836ca3f305df8@heytings.org> <8ef8eaba-1add-e87e-247e-71888beaf1f8@yandex.ru> <837d3ak8lf.fsf@gnu.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="32740"; 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 Sun Aug 14 20:15:24 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 1oNI8y-0008Ly-En for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 20:15:24 +0200 Original-Received: from localhost ([::1]:43672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNI8x-0005PM-ES for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 14:15:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNI8d-0005PB-T6 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 14:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNI8c-0001kI-MY for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 14:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNI8c-0008Np-H2 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 14:15: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: Sun, 14 Aug 2022 18:15: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.166050085232151 (code B ref 56682); Sun, 14 Aug 2022 18:15:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 14 Aug 2022 18:14:12 +0000 Original-Received: from localhost ([127.0.0.1]:39887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNI7n-0008MV-Vc for submit@debbugs.gnu.org; Sun, 14 Aug 2022 14:14:12 -0400 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:37717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNI7l-0008MH-Mx for 56682@debbugs.gnu.org; Sun, 14 Aug 2022 14:14:11 -0400 Original-Received: by mail-wm1-f42.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso6858285wma.2 for <56682@debbugs.gnu.org>; Sun, 14 Aug 2022 11:14:09 -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=AH52O0ffkKcFDoXK0fBN/Sarkk2NWGLMo8cUP3B8JQo=; b=JcXrs6Krs5cGkrE0SQmwdeys1D7b5JbKvCU0GKuVY+qy3yJ4mihzkZ0jct9SDI1C7g X+OBCKoD/D7rGHVkgqrthEei3PKQFqi4oHUW7wHAVjPJI8G/bsGzLS2zT8epUq51str8 Br6mqx0WAnMWXdXvtM9yrYcff+4m5xKYCDovGNgSdt+JI8wxMp/GC0Xp5B+mZFJU8t2o i9J31yjoaAgplmWx84upW18+iH31QnD7Mo+5Eug2tXsKj3yRiceuUhDmvZpr+/zSI33Q BBr15OH/PVmF+y+PkpcbDZfss+OItPtWBS5iqFiJXNkLm4Jh2WKcLogZXVXc1oxLnrOQ tmUA== 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=AH52O0ffkKcFDoXK0fBN/Sarkk2NWGLMo8cUP3B8JQo=; b=UNN3jXNQKDqSuzkyZi/YcWpXypCBmSQIJ8cq9THwvO6b4m3lWP6MUh/aP8Qq0TNKbq oCufYhIdD2FTH0IHDFCnMkwz6t3QQBGoq96YFVwukdYO5p0O8xrE0bvPwmKWLKtcmv57 aFd79/RnhUGZjUNd9bPKIKr1Iofm/Nx5Xo5i5qoKha2KPfZTO6EWpYBSdDDsp4wz9m8a HdBtrQUaKtjls7PvMdWzbbRMMgw06GVahEvO6koD4eRn2ie0anYkrVFrwmrZ5KN1tjkc 07WXCNFry1+apEnPDkvP2RxpIKyCJfy1nsnlWtr8sGRCY6OunEKvMNzMZYkmD47leXqg pv3A== X-Gm-Message-State: ACgBeo1ioGkeOZv+JRy0FfHIqGzfNgLyfRIq5uNneWEgkzZb7/ulYflr UM804jZIE+zqmxP/qkFdByo= X-Google-Smtp-Source: AA6agR48sGVavO5tFG7ILGda1DIcFrNgIV8DbHhzsDcr/NTAo6IcbuNkfJiOkOwZb9NjR+8SCOG43Q== X-Received: by 2002:a05:600c:198e:b0:3a5:d4a2:8896 with SMTP id t14-20020a05600c198e00b003a5d4a28896mr6160469wmq.140.1660500843873; Sun, 14 Aug 2022 11:14:03 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f13-20020a05600c154d00b003a52969e89csm7614118wmg.4.2022.08.14.11.14.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Aug 2022 11:14:03 -0700 (PDT) Content-Language: en-US In-Reply-To: <837d3ak8lf.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:239688 Archived-At: On 14.08.2022 21:01, Eli Zaretskii wrote: >> Date: Sun, 14 Aug 2022 20:51:14 +0300 >> Cc: 56682@debbugs.gnu.org, Eli Zaretskii , >> monnier@iro.umontreal.ca >> From: Dmitry Gutov >> >>> If the conclusion is, after some reasonable effort, that there is no way >>> to make syntax-ppss significantly faster in one way or another in such >>> cases, and that there is no way to make font locking reasonably accurate >>> even when it doesn't have access to the whole buffer, it might make >>> sense to provide user options to fine-tune the behavior.  But we are not >>> there yet. >> >> Both conclusions lead to removing the applications of narrowing from >> handle_fontified_prop. > > We will not remove that, no. Please look at the branch. It moves the (potential) narrowing from C to Lisp. >> So how about we either do that (defaulting to accurate font-lock), >> or merge the branch I proposed, and then continue on to the more >> complex developments? > > Please wait with requests to merge until I had time to review the > branch. Waiting, and thanks. >> Implementing the "font locking reasonably accurate even when it doesn't >> have access to the whole buffer" would also have to be implemented in >> Lisp, so narrowing outside of font-lock doesn't make sense. > > Cannot parse this, sorry. I guess some typo? The implementation of the idea that Gregory mentioned (font locking reasonably accurate even when it doesn't have access to the whole buffer) will have to be done in Lisp anyway. So that's where the narrowing should be applied too. Does that parse? Not sure how to phrase it better.