From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brennan Vincent 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, 28 Dec 2023 10:37:09 -0500 Message-ID: <8734vmwd7e.fsf@prescott.mail-host-address-is-not-set> References: <875y0jw5jf.fsf@prescott.mail-host-address-is-not-set> 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="7060"; mail-complaints-to="usenet@ciao.gmane.io" To: Stefan Monnier , 68072@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 28 16:38:17 2023 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 1rIsSf-0001gA-7t for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Dec 2023 16:38:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIsSS-000333-4N; Thu, 28 Dec 2023 10:38:04 -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 1rIsSR-00032t-4d for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 10:38:03 -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 1rIsSQ-00088k-TM for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 10:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIsSP-0002Y6-Sc for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 10:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Dec 2023 15:38:01 +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.17037778519756 (code B ref 68072); Thu, 28 Dec 2023 15:38:01 +0000 Original-Received: (at 68072) by debbugs.gnu.org; 28 Dec 2023 15:37:31 +0000 Original-Received: from localhost ([127.0.0.1]:40186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIsRu-0002XH-Ks for submit@debbugs.gnu.org; Thu, 28 Dec 2023 10:37:30 -0500 Original-Received: from smtp.umanwizard.com ([54.203.248.109]:35916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIsRr-0002X0-JK for 68072@debbugs.gnu.org; Thu, 28 Dec 2023 10:37:29 -0500 Original-Received: from localhost ([173.205.212.102]) by smtp.umanwizard.com ; 28 Dec 2023 15:37:13 +0000 X-Fes-Received-For: 68072@debbugs.gnu.org X-Fes-Received-From: In-Reply-To: X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost 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:276982 Archived-At: Stefan Monnier writes: > I can definitely agree: `pp` using the default `pp-default-function` > (i.e. `pp-fill`) is *not* a good idea if you have changed > `lisp-indent-function` (unless you changed it to a faster function, of > course). We may be able to fix this O(N=C2=B2) behavior, but the underly= ing > principle stands: it's much too easy to fall into another O(N=C2=B2) beha= vior. > Thanks for the tip and I can definitely remove the customization of lisp-indent-function to common-lisp-indent-function. I actually don't remember why I originally set it since I don't write common lisp... but anyway, if we don't expect changing lisp-indent-function globally to behave nicely with other features (like pp), perhaps lisp-indent-function shouldn't be Customize-able , or we should at least mention this in the documentation? >> This also causes eglot (in its default configuration) to hang when >> opening large Rust files, since rust-analyzer tends to send large amount= s of >> inlay hints, and eglot logs the messages it receives as pretty-printed >> Lisp objects. > > 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? > > > Stefan