unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Completion delay with vertico
@ 2024-08-11 13:48 Arash Esbati
  0 siblings, 0 replies; only message in thread
From: Arash Esbati @ 2024-08-11 13:48 UTC (permalink / raw)
  To: emacs-help

Hi all,

when I open a .tex file with AUCTeX and vertico, I see a noticeable
delay when I ask for a macro completion.  To reproduce, do:

• emacs -Q
• eval in scratch:
    (progn
      (package-initialize t)
      (package-activate 'auctex)
      (package-activate 'vertico)
      (vertico-mode 1))
• Open a .tex file, say something like this:
    \documentclass{article}

    \begin{document}

    \end{document}

    %%% Local Variables:
    %%% mode: latex
    %%% TeX-master: t
    %%% End:
• Hit 'C-c C-m use' and see the delay in completion.  I think this delay
  happens only upon first request, subsequent completion attempts happen
  fast.

I profiled the above and it gives:

         730  91% + command-execute
          43   5%   redisplay_internal (C function)
          25   3%   Automatic GC
           3   0%   help-command-error-confusable-suggestions
           1   0% + timer-event-handler
           0   0%   ...

whereas the major cpu time is consumed here:

         730  91% - command-execute
         730  91%  - byte-code
         551  68%   - completing-read
         551  68%    - completing-read-default
         551  68%     - apply
         551  68%      - vertico--advice
         551  68%       - apply
         551  68%        - #<native-comp-function completing-read-default>
         506  63%         - vertico--exhibit
         501  62%          - vertico--display-candidates
         501  62%           - vertico--resize-window
         501  62%              window-text-pixel-size
           4   0%          - vertico--update
           3   0%           - redisplay
           1   0%              redisplay_internal (C function)
           1   0%             input-pending-p
           1   0%          - vertico--arrange-candidates
           1   0%           - vertico--affixate
           1   0%            - TeX--completion-annotation-function
           1   0%               LaTeX--completion-annotation-from-math-menu
          14   1%           redisplay_internal (C function)
         118  14%   - read-extended-command
         118  14%    - read-extended-command-1
         118  14%     - completing-read-default
         118  14%      - apply
         118  14%       - vertico--advice
         118  14%        - apply
         118  14%         - #<native-comp-function completing-read-default>
          30   3%          - vertico--exhibit
          25   3%           - vertico--update
          21   2%            - redisplay
           8   0%               redisplay_internal (C function)
           4   0%              input-pending-p
           4   0%           - vertico--arrange-candidates
           4   0%            - vertico--affixate
           4   0%             - read-extended-command--affixation
           4   0%                #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_61>
           1   0%           - vertico--display-candidates
           1   0%            - vertico--resize-window
           1   0%               window-text-pixel-size
          29   3%            redisplay_internal (C function)
          61   7%   - find-file-read-args
          61   7%    - read-file-name
          61   7%     - read-file-name-default
          61   7%      - completing-read-default
          61   7%       - apply
          61   7%        - vertico--advice
          61   7%         - apply
          61   7%          - #<native-comp-function completing-read-default>
          18   2%           - vertico--exhibit
          18   2%            - vertico--update
          16   1%             - vertico--recompute
          15   1%              - vertico--filter-completions
          15   1%               - completion-all-completions
          15   1%                - completion--nth-completion
          15   1%                 - seq-some
          15   1%                  - seq-do
          15   1%                   - mapc
          15   1%                    - #<byte-code-function 6EE>
          15   1%                     - #<byte-code-function 6FF>
          13   1%                      - completion-basic-all-completions
          13   1%                       - completion-pcm--all-completions
          10   1%                        - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
          10   1%                         - complete-with-action
          10   1%                            all-completions
           1   0%                        - completion-file-name-table
           1   0%                           file-name-all-completions
           1   0%                        - #<byte-code-function 718>
           1   0%                         - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_109>
           1   0%                          - TeX-symbol-list-filtered
           1   0%                           - TeX-symbol-list
           1   0%                              TeX-auto-list-information
           1   0%                      - completion-pcm-all-completions
           1   0%                       - completion-pcm--find-all-completions
           1   0%                        - completion-pcm--all-completions
           1   0%                         - completion-file-name-table
           1   0%                            file-name-all-completions
           1   0%                      - completion-emacs22-all-completions
           1   0%                       - completion-file-name-table
           1   0%                          file-name-all-completions
           1   0%              - vertico-sort-history-length-alpha
           1   0%               - vertico--history-hash
           1   0%                  abbreviate-file-name
           2   0%             - redisplay
           2   0%                redisplay_internal (C function)
          13   1%             redisplay_internal (C function)
          43   5%   redisplay_internal (C function)
          25   3%   Automatic GC
           3   0%   help-command-error-confusable-suggestions
           1   0% + timer-event-handler
           0   0%   ...

Have others experienced something similar?  This is on macOS with Emacs
from master (423c86cb).

Best, Arash



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-11 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11 13:48 Completion delay with vertico Arash Esbati

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).