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

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

Re: Too long completion delay time in LISP interaction mode.


From: Tassilo Horn
Subject: Re: Too long completion delay time in LISP interaction mode.
Date: Wed, 20 Oct 2021 08:19:02 +0200
User-agent: mu4e 1.7.0; emacs 29.0.50

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

>> So the bottleneck is in the lambda which you didn't expand.
>
> I disabled hotfuzz now, and the following result is obtained by
> profiling the CPU with the same steps as described above:
>
>          472  88% - command-execute
>          472  88%  - funcall-interactively
>          472  88%   - counsel-M-x
>          472  88%    - let
>          448  84%     - ivy-read
>          448  84%      - apply
>          444  83%       + #<lambda 0x1b03f67daa2b12f2>
>            4   0%       + my/company--transform-candidates
>           24   4%     + counsel--M-x-externs
>           45   8% + ...
>           15   2% + redisplay_internal (C function)

Well, again you didn't expand the lambda where most of the time is
spent...

>> But I'm also not sure if you are profiling the right thing because I
>> don't think that in-buffer completion (in terms of
>> `completion-at-point-functions') starts with M-x (or counsel-M-x).
>
> I'm not sure if it's relevant to the following configuration in my
> `~/.emacs.d/init.el':

I also use corfu but I think now I know what happens.  The thing is that
doing M-x profiler-report RET takes much longer (88% of the profiling
time) than computing the completion candidates.  That is done in the

    45   8% + ...

part which you should also expand.

When I do your recipe, the first 54% part is also the M-x
profiler-report RET part, and the

         327  45% - ...

is the actual completion part (using vertico).

--8<---------------cut here---------------start------------->8---
         391  54% - command-execute
         391  54%  - call-interactively
         390  53%   - byte-code
         390  53%    - read-extended-command
         390  53%     - completing-read
         390  53%      - completing-read-default
         390  53%       - apply
         390  53%        - vertico--advice
         390  53%         - apply
         390  53%          - #<compiled 0x8411fe8870440ec>
         375  51%           - read-from-minibuffer
         357  49%            + vertico--exhibit
           5   0%            + command-execute
           1   0%   + funcall-interactively
         327  45% - ...
         265  36%  - or
         265  36%   - if
         265  36%    - let*
         260  35%     - unwind-protect
         260  35%      - progn
         129  17%       + corfu--recompute-candidates
         121  16%       + let*
          10   1%       + if
           5   0%     + if
          62   8%    Automatic GC
           5   0% + timer-event-handler
--8<---------------cut here---------------end--------------->8---

HTH,
Tassilo



reply via email to

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