From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Tassilo Horn <tsdh@gnu.org>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Too long completion delay time in LISP interaction mode.
Date: Wed, 20 Oct 2021 14:42:29 +0800 [thread overview]
Message-ID: <CAGP6POLCv_x2WEpt+gvztbimYPE_xrBD=s9NbzH6Co0YyAQEmA@mail.gmail.com> (raw)
In-Reply-To: <87lf2orz4c.fsf@gnu.org>
On Wed, Oct 20, 2021 at 2:25 PM Tassilo Horn <tsdh@gnu.org> wrote:
>
> 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...
To be frank, I don't know how to expand it.
> >> 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.
Again, I don't know how to expand it.
> 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).
I don't use corfu [1] and vertico [2], but thank you for letting me
your configuration.
[1] https://github.com/minad/corfu
[2] https://github.com/minad/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---
Anyway, after disabling the hotfuzz, the completion delay has been
reduced to an acceptable time.
[3] https://github.com/axelf4/hotfuzz
HZ
next prev parent reply other threads:[~2021-10-20 6:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 3:11 Too long completion delay time in LISP interaction mode Hongyi Zhao
2021-10-20 4:11 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-20 4:27 ` Hongyi Zhao
2021-10-20 5:01 ` Tassilo Horn
2021-10-20 5:29 ` Hongyi Zhao
2021-10-20 5:49 ` Tassilo Horn
2021-10-20 6:11 ` Hongyi Zhao
2021-10-20 6:19 ` Tassilo Horn
2021-10-20 6:42 ` Hongyi Zhao [this message]
2021-10-20 7:20 ` Tassilo Horn
2021-10-20 7:35 ` Hongyi Zhao
2021-10-21 5:32 ` Hongyi Zhao
2021-10-21 5:45 ` Tassilo Horn
2021-10-21 6:14 ` Hongyi Zhao
2021-10-21 8:50 ` Tassilo Horn
2021-10-21 10:38 ` Hongyi Zhao
2021-10-20 7:24 ` Hongyi Zhao
2021-10-20 7:37 ` Tassilo Horn
2021-10-20 9:17 ` Hongyi Zhao
2021-10-20 6:24 ` Hongyi Zhao
2021-10-20 5:58 ` Hongyi Zhao
2021-10-20 15:30 ` [External] : " Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGP6POLCv_x2WEpt+gvztbimYPE_xrBD=s9NbzH6Co0YyAQEmA@mail.gmail.com' \
--to=hongyi.zhao@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tsdh@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).