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: Thu, 4 Aug 2022 04:08:20 +0300 Message-ID: <3e180c88-3ee8-7049-dc3f-88ae2636cfe1@yandex.ru> References: <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> <83v8rf5894.fsf@gnu.org> <65cb7c73fd4a999cca00@heytings.org> <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <8c7321f2f36494299e61@heytings.org> <8c7321f2f336523624e3@heytings.org> <83r1202meh.fsf@gnu.org> <6020ffaf-9069-0070-76cf-a13379ef01b5@yandex.ru> <83les71ilg.fsf@gnu.org> <06c5560d-3009-e5a5-3d33-fe5d2ec32d6b@yandex.ru> <74ddc877f17a06d8f120@heytings.org> <83wnbq62sz.fsf@gnu.org> <74ddc877f1b7de1eaf91@heytings.org> <9a8f98b5-3943-be38-908a-3aad3f282ccb@yandex.ru> <68722578-414c-a0d9-57f2-21a0e6d74c0f@yandex.ru> <83k07p5ymu.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="28971"; 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 Thu Aug 04 03:09: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 1oJPMP-0007I9-It for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 03:09:13 +0200 Original-Received: from localhost ([::1]:51358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJPMO-0000cK-0D for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Aug 2022 21:09:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJPME-0000aL-NJ for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 21:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJPME-000269-EN for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 21:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJPME-00063c-A3 for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 21:09: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: Thu, 04 Aug 2022 01:09: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.165957531023232 (code B ref 56682); Thu, 04 Aug 2022 01:09:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 4 Aug 2022 01:08:30 +0000 Original-Received: from localhost ([127.0.0.1]:50531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJPLh-00062e-QB for submit@debbugs.gnu.org; Wed, 03 Aug 2022 21:08:30 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:43997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJPLg-00062O-8I for 56682@debbugs.gnu.org; Wed, 03 Aug 2022 21:08:29 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id n20-20020a05600c3b9400b003a4f2261a7eso1639690wms.2 for <56682@debbugs.gnu.org>; Wed, 03 Aug 2022 18:08:28 -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=/Zn+HBgdBrPeBIoAzmA0mvISiV/8lFTLN4DnjHxYUeA=; b=pCgbuFjkNT3pvVabQtsvWJHdFcQJ3pBfxvQRHqgRRmdoZEASRgss7lh0LbwarKLv2H 4HUTVlPuzR20+mzTf+9R++PkI4AmA+b7ZnRc/XDViOaTymaf45uqVdqEoKE4x3Qr+Jas KxxRdxC/aTVTclGKDMQCMQ3buaLPCdD3xDQJ3Lk8x4E25VP2S+3wtT9oOjZ0y5TqF1Zk Qbtv4YqtasSGtLEce8YZK8cGWgahSuImQicAYKSrJmcSULpznmleWEY1JsV8sJURlWjE y/nro61RUp59OdGAb7WJPNvCXfeOhS7HQvxpZYCGQeqxQBEt8V1jhJ5Q0SSdHbV4aPoN 7tkQ== 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=/Zn+HBgdBrPeBIoAzmA0mvISiV/8lFTLN4DnjHxYUeA=; b=QwE8mV2RI/PB0Cki++BKbEEEqij5WJ8JQY/fi5pb1W8xbQwZFLATxrTu66XodSBP9A qGWLIj8AJzCzH3vq2+ki1dM0Ru/kPEXK411fV89pZIIEB1cQRqvB5xXwR1NAwoNcd8Tj kXRdYQI2f+MGZUsIX9qyczVKS8/YVFyWqQHyUtjhusxkCfDjlOsTmPNEzp3ngQ2eRNdR BBsmh3/qgfEiKaB9RfwqFn+CopLby+d/J2tV3CaiS58SzJCj3gstyJ0M4I7/VA+xCZSb 73hSBp+IE10AwogI2A0OJQBAtJEmDZd56lwpBEzeZoYIEw/UrtN+UpFWyD5bNmuO0F7M pqHg== X-Gm-Message-State: ACgBeo1QllKpJM7J+KjpqY8S0iTok/uhQD952TNsvyGPlnMOMJo+GEjv 5mnaiNaDYayR2S0Bh19WjGU= X-Google-Smtp-Source: AA6agR6nwfrB4+YK9OIzoW2gp9VSO12Jg23u1XUPtMmDeYCaNFi7lnX5coEAFt+8WLPbpxMhHpuxRA== X-Received: by 2002:a05:600c:2056:b0:3a3:2cf8:ec9 with SMTP id p22-20020a05600c205600b003a32cf80ec9mr4436869wmg.51.1659575302177; Wed, 03 Aug 2022 18:08:22 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i8-20020a05600c480800b003a4f1385f0asm3952992wmo.24.2022.08.03.18.08.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Aug 2022 18:08:22 -0700 (PDT) Content-Language: en-US In-Reply-To: <83k07p5ymu.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:238662 Archived-At: On 03.08.2022 14:56, Eli Zaretskii wrote: >> Date: Wed, 3 Aug 2022 03:26:02 +0300 >> From: Dmitry Gutov >> Cc:56682@debbugs.gnu.org,monnier@iro.umontreal.ca >> >> On 03.08.2022 03:00, Dmitry Gutov wrote: >>> On 02.08.2022 19:19, Gregory Heytings wrote: >>>>>> Try to open the dictionary.json with Emacs on master a month ago. >>>>> I believe it can also be done with the current master, just after >>>>> setting long-line-threshold to the nil value.  Right? >>>>> >>>> Indeed.  With master from one month ago it's even more crystal-clear >>>> that you see the statu quo ante. >>> If I set long-line-threshold to nil, does that also disable the >>> redisplay optimizations related to long lines? >>> >>> Ones that caused scrolling delays even after the buffer has been fully >>> fontified. >> I mean those that*fixed* the said scrolling delays, of course. > I don't think I understand which changes you had in mind (could you > give a less vague pointer?), but I think the answer is NO: that > variable disables only the recent changes related to long lines. I'm not sure if there are separate/specific changes to speak of (sorry, I'm flying blind), but previously I remarked in this discussion that on master pushing C-p can still result in sluggish response (at the end of a long line), even after the current window has been fontified (meaning font-lock has finished its work), and Gregory remarked that I should try the branch feature/long-lines-and-font-locking where this was fixed. I did try the branch and indeed did not experience that sluggishness anymore. But that probably is a separate issue from slow font-lock. So to try to debug any remaining speed issues with font-lock, it would be great to eliminate other sources of slow display first. In particular ones coming from a low-level subsystem I cannot as easily benchmark/debug/etc as Lisp code. The setting (setq long-line-threshold nil syntax-wholeline-max most-positive-fixnum) indeed makes all the speed issues come back, including the aforementioned sluggishness. You can try it yourself with downloadify.js I attached to the previous email. It's not a huge file either: the line is 90077 characters long.