From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Tue, 02 Aug 2022 21:43:35 +0000 Message-ID: <74ddc877f18a8db624e9@heytings.org> References: <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> <8c7321f2f3ec1ef81af9@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28389"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, Eli Zaretskii , Dmitry Gutov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 02 23:44:10 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 1oIzgQ-0007Gk-KL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 23:44:10 +0200 Original-Received: from localhost ([::1]:57844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIzgP-0001UL-FO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 17:44:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIzgI-0001UC-0B for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 17:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIzgH-000666-Mb for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 17:44:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIzgH-00034Y-JB for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 17:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Aug 2022 21:44: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.165947662111773 (code B ref 56682); Tue, 02 Aug 2022 21:44:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 2 Aug 2022 21:43:41 +0000 Original-Received: from localhost ([127.0.0.1]:45250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIzfx-00033o-GH for submit@debbugs.gnu.org; Tue, 02 Aug 2022 17:43:41 -0400 Original-Received: from heytings.org ([95.142.160.155]:36096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIzft-00033d-7V for 56682@debbugs.gnu.org; Tue, 02 Aug 2022 17:43:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659476615; bh=wmqryvVlxsZ0GZx0qhxp/zk6tzlExpYnkhIVqslxCOU=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=du+84I1B6g7QK32hoH4oKKfz9mLUs4Ga6DZUgRhokIHjpZA5hqUXK2+FcvN2zZYcL kAb7nFfffu/Xhm/2x4neYjDHKYehQwI/oA4bg7K8+xZd4Et3GCrT8a3JfoGuj0Fp45 YpSme+4XbKjVTqW/kY109iCyBoMIAT4s4JcNa6Z6+jOycgghQerNhahZ87Qp7SPCp9 +Dm6UR0Yghpr/0bghREKvRwctHjBosR4XduVODs7R+WsRIYa4uhnyKUuXk681swzxw 2jVmnJFwczgMyoeI3VtqggghjhgtjH5Sa9BB5aGUuFHMi+ttsyWtQV0qA4W9E9nLV3 x3u7qyrc2EfLg== In-Reply-To: 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:238589 Archived-At: > > Hmmm was that using the GNU ELPA `json-mode` package? > No, it's with emacs -Q. >> Sure, there are perhaps modes that are slower, but my tests seem to >> indicate that the 1/10 ratio is correct, or IOW that syntax-ppss is an >> order of magnitude slower than opening the file. > > You might be right. > > But there are still significant differences between different major > modes: > > LISP> (benchmark-run 1 (fundamental-mode) (parse-partial-sexp (point-min) (point-max))) > (0.276774213 0 0.0) > > LISP> (benchmark-run 1 (fundamental-mode) (syntax-ppss (point-max))) > (0.329234636 0 0.0) > > ELISP> (benchmark-run 1 (emacs-lisp-mode) (syntax-ppss (point-max))) > (0.392759479 0 0.0) > > ELISP> (benchmark-run 1 (js-mode) (syntax-ppss (point-max))) > (1.036089104 7 0.20054423700000001) > > ELISP> (benchmark-run 1 (nxml-mode) (syntax-ppss (point-max))) > (1.169055192 7 0.15886504199999996) > > ELISP> (benchmark-run 1 (cperl-mode) (syntax-ppss (point-max))) > (1.857638439 9 0.19724271499999996) > > (this was in a 5MB buffer). > Yes, that's correct. (But did you test each mode with the same 5 MB buffer? If so, that's perhaps not representative of what happens in reality.) The general idea is that syntax-ppss is currently an order of magnitude too slow for "too large" buffers.