GNU bug report logs -
#73766
30.0.91; (documentation 'pcase) can take several seconds
Previous Next
Reported by: Yikai Zhao <yikai <at> z1k.dev>
Date: Sat, 12 Oct 2024 08:03:01 UTC
Severity: normal
Found in version 30.0.91
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #26 received at 73766 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, João Távora
> <joaotavora <at> gmail.com>,
> 73766 <at> debbugs.gnu.org
> Date: Thu, 17 Oct 2024 13:22:00 -0400
>
> Eli, this is a non-trivial chunk of code and it's used more often than
> just to get the docstring of `pcase`, so I'm clearly not obviously safe
> for `emacs-30`.
>
> Here are some options I can think of:
>
> - Install it `emacs-30` anyway.
> - Revert on `emacs-30` the change that introduced the slowdown:
>
> commit 052c2ce0284c5193c9d6768a45a9b3508af51230
> Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Sun Feb 11 17:43:37 2024 -0500
>
> (pcase): Add buttons to the macros' defs in the docstring of `pcase`
>
> * lisp/emacs-lisp/pcase.el (pcase--find-macro-def-regexp): New var.
> (find-function-regexp-alist): Add entry for `pcase-macro`s.
> (help-fns--signature): Move declaration to where we know it is valid.
> (pcase--make-docstring): Add buttons to jump to the definition
> of Pcase macros.
>
> - Install on `emacs-30` a simpler and more focused change, which should
> work acceptably in most cases, such as:
>
> diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
> index 5a7f3995311..811d42793cd 100644
> --- a/lisp/emacs-lisp/pcase.el
> +++ b/lisp/emacs-lisp/pcase.el
> @@ -214,7 +214,7 @@ pcase--make-docstring
> (save-excursion
> (forward-char -1)
> (insert (format-message " in `"))
> - (help-insert-xref-button (help-fns-short-filename filename)
> + (help-insert-xref-button (file-name-nondirectory filename)
> 'help-function-def symbol filename
> 'pcase-macro)
> (insert (format-message "'."))))
I'd prefer the last alternative for emacs-30, but then you say:
> There's still a remaining performance issue for things like
> `eldoc-mode`, admittedly where we'd really want it to be instantaneous,
> but I think this should be fixed by making `eldoc` call `documentation`
> in a special way to skips those useless computations (eldoc just wants
> a "short doc" anyway). This affects other functions using the
> `function-documentation` property in a similar way.
Does it mean that this slowdown of eldoc was also caused by commit
052c2ce0284c5193c9d6768a45a9b3508af51230, and if so, does the patch
you've shown previously (and which you consider not safe enough for
emacs-30) solve the eldoc slowdown as well?
This bug report was last modified 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.