From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68072: pp functions have O(n^2) runtime with lisp-indent-function set to common-lisp-indent-function Date: Thu, 04 Jan 2024 22:50:51 -0500 Message-ID: References: <875y0jw5jf.fsf@prescott.mail-host-address-is-not-set> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31235"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Brennan Vincent , 68072@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 05 04:52:13 2024 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 1rLbFk-0007uZ-Um for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jan 2024 04:52:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLbFY-00054t-QX; Thu, 04 Jan 2024 22:52:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLbFX-00053s-55 for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2024 22:51:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLbFW-0005WH-Qu for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2024 22:51:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rLbFa-0002Im-BD for bug-gnu-emacs@gnu.org; Thu, 04 Jan 2024 22:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jan 2024 03:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68072 X-GNU-PR-Package: emacs Original-Received: via spool by 68072-submit@debbugs.gnu.org id=B68072.17044266678784 (code B ref 68072); Fri, 05 Jan 2024 03:52:02 +0000 Original-Received: (at 68072) by debbugs.gnu.org; 5 Jan 2024 03:51:07 +0000 Original-Received: from localhost ([127.0.0.1]:56116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLbEh-0002Ha-7l for submit@debbugs.gnu.org; Thu, 04 Jan 2024 22:51:07 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rLbEe-0002H3-6Q for 68072@debbugs.gnu.org; Thu, 04 Jan 2024 22:51:06 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C3877440A71; Thu, 4 Jan 2024 22:50:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1704426652; bh=QaDqDVTEYp8TKqg6w8CFfVxO61u/xpFRhOoh/e7qBxA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TdFfxFzmQC31ze0qtgiscal8vj0fIN+pU40B0vmot4Dx2FmQqVJACP6XX5+Cu186A mmTPMiqauhIPnRaAGzcSTNmKSJ7L7Y0O3O9rXmo6ap6rGZhIP9xA6y2HlAksOZry5Z 7zFYiLz6lD6t7k53ETYpEbTwLmXOqsbe7ofyMMYuMY3r2PnAxlovWBkucaaK4ITXcX TsEKsbkQuOwEXZ00j5wvsyqcOFPqwi1zmsroGJDLhH5Fcx6JB0jEQdsqaL3SoNjp3w CozJkfC2KlnJ47EoAfeQMlFd14rpUOo16JqNHev1TkYMzp1icXCvTsjYZqCHyw8RuH tQMPKUldhQyWQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 65E6644092E; Thu, 4 Jan 2024 22:50:52 -0500 (EST) Original-Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 36CF21203CD; Thu, 4 Jan 2024 22:50:52 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Thu, 28 Dec 2023 02:20:16 -0500") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277354 Archived-At: > And Eglot should probably use a faster pretty printer than the default > `pp` for that. Maybe we should make `lisp-data-mode` set > `pp-default-function` or `lisp-indent-function` to avoid such problems? Jsonrpc uses the pretty printer via `pp-to-string` so there's no major mode to change (and `pp-to-string` isn't told whether it's printing code or data =F0=9F=99=81), and in order to run on older Emacsen it can't really= use the `pp-function` argument either. So in the mean time, maybe the patch below is in order? Jo=C3=A3o, any comment? Stefan diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 3f33443f321..f0f5842a0ee 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -1011,7 +1010,9 @@ (format "%s%s" preamble (or (and foreign-message + (let ((lisp-indent-function ;bug#68072 + #'lisp-indent-function)) (concat "\n" (pp-to-string - foreign-message))) + foreign-message)))) (concat log-text "\n"))))))) (goto-char (point-max))