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: Fri, 5 Aug 2022 15:50:35 +0300 Message-ID: <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> References: <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> <100d08b3-c25b-683f-6def-39052107ab59@yandex.ru> <83h72r16g1.fsf@gnu.org> <640c2e07-98e1-96d6-bb02-19f5f03f637f@yandex.ru> <834jyq29o1.fsf@gnu.org> <92da07bd028e3ede61a6@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="22980"; 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 Fri Aug 05 14:52:28 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 1oJwoW-0005sY-EF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 14:52:28 +0200 Original-Received: from localhost ([::1]:37616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJwoV-00052D-E4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 08:52:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJwn8-0003ao-Is for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 08:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJwn8-00042y-8v for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 08:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJwn8-0000md-4q for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 08:51: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: Fri, 05 Aug 2022 12:51: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.16597038482992 (code B ref 56682); Fri, 05 Aug 2022 12:51:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 5 Aug 2022 12:50:48 +0000 Original-Received: from localhost ([127.0.0.1]:56640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJwmu-0000mC-Fc for submit@debbugs.gnu.org; Fri, 05 Aug 2022 08:50:48 -0400 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:54838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJwmq-0000lx-U3 for 56682@debbugs.gnu.org; Fri, 05 Aug 2022 08:50:47 -0400 Original-Received: by mail-wm1-f51.google.com with SMTP id n185so1372861wmn.4 for <56682@debbugs.gnu.org>; Fri, 05 Aug 2022 05:50:44 -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=NuZgNuQDaNfgFm1Qs5kg9t7ZFVx8jNn/FXWMrCKbQ/A=; b=HZc8h9iD9fFWtNtEWr+YU3V42tV43bwB9idu4P5ku+/SIQ6yF4DXYOTZqvPJ/q1eA5 oHz4pyEeVbO9EfEpY7/1PvPI/Xvyt/5NfEjpnwwsfmikdMDVQCdUjfeUWM+25jVDPfvR 2hfReI2JPLAU2X/e9FqcV9UPL/P6As4mgf6pt9Ek9hAaTRxxPVNQssqniFBEVJTDRBHa 2/1rt1mweIqeS9QpQPHNJF3apxFg/tnPWRutWrN12psxLHOhGmQ756cH/Yu1ucVh8J9c qSDOQs39UP3pKDNs6s7rxVm0KvdBYivOhCqUU5L47xg+wqyXz9DP2+zIwUgC9YzAPTku 5f4Q== 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=NuZgNuQDaNfgFm1Qs5kg9t7ZFVx8jNn/FXWMrCKbQ/A=; b=qbuWH4nRXMhyiIChCWgqfnPDtvea72yfwUipsSr2Z89/vlj/nBCdVF+DRfxzn+6Csj JJ/9ZHRy8M1UtzY/84/h9lcrIPkSAFl0eBoRqLb/+T0F7xA3VD/RFcwPmOQTQT4PjFpe uFwoRG9NKtcAPKbGof0NJHC/t2R1wv1xjJmceFVmCo9cimqPQg/llsejkdKZUxf0RIEb NPGvL/+AjL7fJnzXNWNs3qnpAjQHBXF5fn37CLHqc9B3XVLxa1Kl35HROAHf+TVIKiPP YwShKcXaj6/6D2axlqfUYsYnBM0grxfvXFLKPVg6eyiNOXm7wsVjqI1Xl8OJ46MyEK6f YePQ== X-Gm-Message-State: ACgBeo0CpD9fqZsEoJ1YMRhU9lerZmMJSTg5CtxWpgkzZko9eSIc6Bur TB/jB7FyKk39K2hEJCBjaLI= X-Google-Smtp-Source: AA6agR65WVcKUNHV4S1udqvu14X6toJ5Gpsyg4j5OTejPHbIbPvr7GOX06KqzSbQjGqCzSk3WsMGmQ== X-Received: by 2002:a05:600c:1906:b0:3a3:4315:682d with SMTP id j6-20020a05600c190600b003a34315682dmr4394919wmq.54.1659703838952; Fri, 05 Aug 2022 05:50:38 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id c6-20020a05600c0a4600b003a308e9a192sm11453806wmq.30.2022.08.05.05.50.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Aug 2022 05:50:37 -0700 (PDT) Content-Language: en-US In-Reply-To: <92da07bd028e3ede61a6@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:238903 Archived-At: On 05.08.2022 15:20, Gregory Heytings wrote: > >> >> Like, we're going from a 255 (?) second delay to 2 second delay >> already without breaking fontification. And yet you're eager to go >> from 2 seconds down to ~0 and sacrifice highlighting correctness? >> > > Yes.  Because as I told you your 2 seconds are 4 for me and 8 for Eli > and 20 for someone else.  And that's in a relatively small file. Is it a "relatively small file" if we've effectively been unable to edit such files for all of 40 years of Emacs's existence? > Note that if it were 2/4/8/20 seconds once, and then no further > slowdowns while editing the file, that would perhaps be okay.  But > that's not the case, you will regularly see a similar 2/4/8/20 seconds > delay. Do our users regularly edit 30MB files? And do a lot of changes in them? In different areas? Note that, again, to see the same delay you would have to edit that file near the beginning, and then visit its end again. If I did that, though, I'm not sure whether I would be more inconvenienced by performance, or by broken syntax highlighting and sexp navigation. font-lock is not just eye candy: it also assists you when editing code. For instance, if I were to edit dictionary.json, I might have needed to look for a certain key and change it somewhere. But if the said key is highlighted as a part of a string value in some places, and only as a key in some others, that can look and feel very puzzling, and slow down my work just the same. Similarly, if I'm editing a large JSON file, I might want to write a small Lisp program which searches for a word, checks that it's inside a string (or, conversely, outside and thus looks like a key), makes all the necessary changes in an automated fashion, and saves the buffer. A broken syntax-ppss wouldn't let me do that. Finally, yes, for some buffer size the initial wait is going to be too much. But that can have a separate solution with a separate threshold.