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: Wed, 27 Dec 2023 19:10:28 -0500 Message-ID: <875y0jw5jf.fsf@prescott.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39771"; mail-complaints-to="usenet@ciao.gmane.io" To: 68072@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 28 01:11:24 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 1rIdzg-000AEs-Pp for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Dec 2023 01:11:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIdzO-0001t0-JT; Wed, 27 Dec 2023 19:11:06 -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 1rIdzM-0001sY-F0 for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 19:11:04 -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 1rIdzM-00037A-5j for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 19:11:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIdzK-0000yi-KB for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 19:11:02 -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 00:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68072 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17037222473736 (code B ref -1); Thu, 28 Dec 2023 00:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2023 00:10:47 +0000 Original-Received: from localhost ([127.0.0.1]:38084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIdz5-0000yC-Fo for submit@debbugs.gnu.org; Wed, 27 Dec 2023 19:10:47 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:38596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIdz3-0000xy-Hj for submit@debbugs.gnu.org; Wed, 27 Dec 2023 19:10:46 -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 1rIdyy-0001qC-Ic for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 19:10:40 -0500 Original-Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIdyv-0002zA-Dr for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 19:10:40 -0500 Original-Received: from localhost ([173.205.212.102]) by smtp.umanwizard.com ; 28 Dec 2023 00:10:32 +0000 X-Fes-Received-For: bug-gnu-emacs@gnu.org X-Fes-Received-From: X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:276948 Archived-At: This also causes eglot (in its default configuration) to hang when opening large Rust files, since rust-analyzer tends to send large amounts of inlay hints, and eglot logs the messages it receives as pretty-printed lisp objects. Note the times in the comments here, showing clearly quadratic behavior: (setq lisp-indent-function 'common-lisp-indent-function) (defun bm1 (sz) (car (benchmark-run (progn (setq p (pp-to-string (make-list sz 'foo))) nil)))) (bm1 1000) ;; 0.057078079 (bm1 2000) ;; 0.22562238599999998 (bm1 10000) ;; 5.312058368 (bm1 20000) ;; 21.00088354