GNU bug report logs - #73766
30.0.91; (documentation 'pcase) can take several seconds

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 73766 <at> debbugs.gnu.org, yikai <at> z1k.dev, joaotavora <at> gmail.com
Subject: bug#73766: 30.0.91; (documentation 'pcase) can take several seconds
Date: Fri, 18 Oct 2024 16:42:32 -0400
>> >> 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?
>> 
>> What I meant is that the 4s slowdown affects both `C-h f` and eldoc,
>> and that the patch I sent which reduces it to 0.12s is IMO sufficient
>> for the `C-h f` case but may still make Emacs feel occasionally a bit
>> sluggish when eldoc hits this 0.12s.
>
> If the slowdown of eldoc is significant, maybe we will be better with
> reverting the change which introduced the regression on emacs-30,
> and then solving on master with your more thorough fix.

The "quickfix" I installed on `emacs-30` should not suffer from
a significant slowdown, no, so I think we're good for `emacs-30`.

The "better" fix I installed on `master`, may still cause a bit of
sluggishness with eldoc, OTOH.

I think the "right" fix for that is to extend `documentation` or `C-h f`
such that the `pcase` doc can distinguish between the (quick to
generate) doc about `pcase` itself and the table of Pcase patterns
defined with `pcase-defmacro` which is appended to the end of the
`pcase` doc (and which can take a bit of time to generate but is not
needed for eldoc).

It would also be good to be able to show the table in a kind of
abbreviated form (one line per Pcase pattern) with a way to
unfold/refold specific patterns' doc.

The same applies to the list of methods displayed in the doc of generic
functions and in the doc of types.


        Stefan





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.