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#68072: pp functions have O(n^2) runtime with lisp-indent-function set to common-lisp-indent-function Date: Thu, 28 Dec 2023 08:23:19 +0200 Message-ID: <83a5pu976w.fsf@gnu.org> References: <875y0jw5jf.fsf@prescott.mail-host-address-is-not-set> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27880"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68072@debbugs.gnu.org To: Brennan Vincent , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 28 07:24: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 1rIjoX-00073p-5Z for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Dec 2023 07:24:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIjoM-0006Kg-6K; Thu, 28 Dec 2023 01:24: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 1rIjoK-0006KD-6D for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 01:24: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 1rIjoJ-0004i0-U7 for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 01:24:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIjoI-0000Iu-Gv for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 01:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Dec 2023 06:24: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.17037446211136 (code B ref 68072); Thu, 28 Dec 2023 06:24:02 +0000 Original-Received: (at 68072) by debbugs.gnu.org; 28 Dec 2023 06:23:41 +0000 Original-Received: from localhost ([127.0.0.1]:38276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIjnw-0000IG-Ga for submit@debbugs.gnu.org; Thu, 28 Dec 2023 01:23:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIjnu-0000I3-Kf for 68072@debbugs.gnu.org; Thu, 28 Dec 2023 01:23:39 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIjnp-0004Px-Mp; Thu, 28 Dec 2023 01:23:33 -0500 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=0tZ4UIpbywBhNTBn7Bve5wOsy+DrWyEUOSAbn7RjuSU=; b=cQ0blSiEaxul scbLIF+ZAb9fmRAFqPqMqlrc3PQSxZuvRVeUQdpTvzmSPMLaMxIbBPPHVHlcawH0jCHd2r1NsaNAw 6YBjqkhtslC78bJGt/h5nyhQWC412TW6v6lWeU5VgjpTe4cVegw3bCibPZ5Awko2f5WzHhG9JSGvw /XNpxYIEQqezZ2j6VLBqBbwncpJHi3NVC+O/gvIK3M/WxtykpIsHJKbkIOnlW/vDpgi4i5ZI0uYW9 WfsXDIR0vdG2RYlNAlgLjB6dHWAFbMmq/Rt+Qe0lPIXr5qvLrBoYVatR1dEZV9guR7MHihp1HHleT KpGYNkF1Qh2CFgSwkliTPw==; In-Reply-To: <875y0jw5jf.fsf@prescott.mail-host-address-is-not-set> (message from Brennan Vincent on Wed, 27 Dec 2023 19:10:28 -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:276952 Archived-At: > From: Brennan Vincent > Date: Wed, 27 Dec 2023 19:10:28 -0500 > > 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 Adding Stefan to the discussion.