all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brennan Vincent <brennan@umanwizard.com>
To: 68072@debbugs.gnu.org
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	[thread overview]
Message-ID: <875y0jw5jf.fsf@prescott.mail-host-address-is-not-set> (raw)

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







             reply	other threads:[~2023-12-28  0:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28  0:10 Brennan Vincent [this message]
2023-12-28  6:23 ` bug#68072: pp functions have O(n^2) runtime with lisp-indent-function set to common-lisp-indent-function Eli Zaretskii
2023-12-28  7:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-28 15:37   ` Brennan Vincent
2023-12-28 17:10   ` Stefan Kangas
2024-01-05  3:50   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-05 13:06     ` João Távora
2024-01-07  5:07       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y0jw5jf.fsf@prescott.mail-host-address-is-not-set \
    --to=brennan@umanwizard.com \
    --cc=68072@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.