bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68072: pp functions have O(n^2) runtime with lisp-indent-function se


From: Eli Zaretskii
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

> From: Brennan Vincent <brennan@umanwizard.com>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]