From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Sat, 06 Aug 2022 09:07:01 +0300 Message-ID: <83a68hzz0a.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> <83v8rf5894.fsf@gnu.org> <65cb7c73fd4a999cca00@heytings.org> <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <8c7321f2f36494299e61@heytings.org> <83v8rc2n1h.fsf@gnu.org> <64084296-1953-8ef8-5938-adfb6fb9b43f@yandex.ru> <83r11uzs8n.fsf@gnu.org> <14845631-c2ef-8371-8606-c858092e3192@yandex.ru> <83mtcizov2.fsf@gnu.org> <83h72qzheq.fsf@gnu.org> <25717d84-3411-a93a-3620-e04fe0571aff@yandex.ru> <83edxuzemr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11495"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 06 08:08:39 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 1oKCzG-0002pA-Em for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 08:08:38 +0200 Original-Received: from localhost ([::1]:38832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKCzF-0000En-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Aug 2022 02:08:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKCyh-0000CJ-06 for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 02:08:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKCyg-0007p5-Ms for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 02:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKCyg-0003Kj-Db for bug-gnu-emacs@gnu.org; Sat, 06 Aug 2022 02:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Aug 2022 06:08: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.165976603312757 (code B ref 56682); Sat, 06 Aug 2022 06:08:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 6 Aug 2022 06:07:13 +0000 Original-Received: from localhost ([127.0.0.1]:60956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKCxt-0003Jh-ER for submit@debbugs.gnu.org; Sat, 06 Aug 2022 02:07:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKCxo-0003JE-By for 56682@debbugs.gnu.org; Sat, 06 Aug 2022 02:07:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59222) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKCxh-0007kA-MW; Sat, 06 Aug 2022 02:07:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=k4Am8r/nPPMwmtjEfjbodOkSrYxUcEfvES2zCNhZRoY=; b=C2xEFmuT/OQm 0cByhA2fRtI6TQspIGJ44Dht3OqxCaYCfEnEvyt0PSw4rIj4mAdz8yiPaQhuXEC/7ZQ/+TRbwrXSJ nrqwWoLlgBl5KKQWFB4UEzoWXVqFLyXewndE39MHhJa3nDVeF8P3fZSt7ZVX8q4RTWd0WlOwyYWws S3UmLTq4XuxNdrznxj+IWAutaQzJzhnwdsC2ZJeIHmPb1F/1WI8u9RPFC4+N3RR1U4iF8vnGPPy/n 9CffWDkZM1HVgPh1Atj9q032/YG5N3d0up/hji9ShFw8Y5hPJ0U6ZY9BppuvagGMoNY//LrKnaGKP iqFEmwQA94CmL5uSxC84Ig==; Original-Received: from [87.69.77.57] (port=1406 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKCxh-0007Q8-4Q; Sat, 06 Aug 2022 02:07:01 -0400 In-Reply-To: (message from Dmitry Gutov on Fri, 5 Aug 2022 23:23:25 +0300) 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:238959 Archived-At: > Date: Fri, 5 Aug 2022 23:23:25 +0300 > Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca > From: Dmitry Gutov > > > We need to look at more than just M->. C-n/C-p, C-v/M-v, C-l are also > > important, as are the time it takes from typing M-x or M-: until you > > see the prompt in the minibuffer, and the time to update the display > > after inserting or deleting a single character. > > I'm not seeing any particular sluggishness in these operations when > visiting dictionary.json. Numbers, please. You have a very fast machine, so what doesn't look sluggish on your system could very well be so on others. > > Thanks, so I guess we may have a solution for JSON files, if disabling > > syntax-propertize-function doesn't have any downsides. What about > > other modes that we see in files with long lines, like XML? > > Someone will need to test it with some typical large file. xml-mode > (alias to nxml-mode) does have a syntax-propertize-function, but it's > probably faster than js-syntax-propertize. > > > And how scalable is the solution you propose, i.e. how it behaves in > > JSON files with a much longer lines? > > parse-partial-sexp is O(length of text span) Isn't that the part you proposed to remove? I was asking about the remaining parts. > Meaning, it scales linearly. You'll see a 10x delay in a JSON file that > is 10x as large. Linear scaling is less optimal than O(0), which is what the current solution produces.