Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled hotfuzz noticeably slower than orderless on macOS #22

Open
tsujp opened this issue Nov 16, 2024 · 0 comments
Open

Compiled hotfuzz noticeably slower than orderless on macOS #22

tsujp opened this issue Nov 16, 2024 · 0 comments

Comments

@tsujp
Copy link

tsujp commented Nov 16, 2024

Invoking C-h o and then typing essentially anything is noticeably very laggy. I am using the dynamic submodule and hotfuzz-max-highlighted-completions is only 25.

If I remove hotfuzz and go back to orderless C-h o responds nearly instantly as I type. My guess is that hotfuzz isn't being interrupted properly upon new input? The completion backend is currently spaghetti to me so I don't know much else. I'd also note I saw considerable time in make-closure.

I compiled the submodule as follows (the same as documented in the repo readme):

cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-march=native &&
	cmake --build build
Hotfuzz cpu profile
        2695  80% - ...
        2695  80%  - vertico--filter-completions
        2695  80%   - completion-all-completions
        2695  80%    - apply
        2695  80%     - #<native-comp-function completion-all-completions>
        2695  80%      - completion--nth-completion
        2695  80%       - seq-some
        2695  80%        - seq-do
        2695  80%         - mapc
        2695  80%          - #<byte-code-function F05>
        2695  80%           - #<byte-code-function 3EB>
        2695  80%            - eval
        2695  80%             - let
        2695  80%              - funcall
        2695  80%               - #<byte-code-function 1EC>
        2695  80%                - hotfuzz-all-completions
        2139  63%                 - help--symbol-completion-table
        2131  63%                  - complete-with-action
        2131  63%                   - all-completions
        2027  60%                    - #<byte-code-function 24B>
        1588  47%                     - #<byte-code-function 836>
        1484  44%                        make-closure
          97   2%                      - cl-some
          72   2%                       - #<byte-code-function 7BD>
          36   1%                        - #<byte-code-function 3BC>
           8   0%                           keywordp
           3   0%                           boundp
          11   0%                          facep
           2   0%                          cl-find-class
           2   0%                          fboundp
           5   0%                  - help-definition-prefixes
           5   0%                   - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_2>
           4   0%                    - radix-tree-lookup
           3   0%                     - radix-tree--lookup
           3   0%                      - radix-tree--lookup
           3   0%                       - radix-tree--lookup
           3   0%                        - radix-tree--lookup
           3   0%                         - radix-tree--lookup
           3   0%                          - radix-tree--lookup
           3   0%                           - radix-tree--lookup
           3   0%                            - radix-tree--lookup
           3   0%                             - radix-tree--lookup
           3   0%                              - radix-tree--lookup
           3   0%                               - radix-tree--lookup
           3   0%                                - radix-tree--lookup
           2   0%                                 - radix-tree--lookup
           2   0%                                  - radix-tree--lookup
           2   0%                                   - radix-tree--lookup
           2   0%                                      radix-tree--lookup
           1   0%                    - radix-tree-insert
           1   0%                     - radix-tree--insert
           1   0%                      - radix-tree--insert
           1   0%                       - radix-tree--insert
           1   0%                        - radix-tree--insert
           1   0%                         - radix-tree--insert
           1   0%                          - radix-tree--insert
           1   0%                           - radix-tree--insert
           1   0%                            - radix-tree--insert
           1   0%                               radix-tree--insert
           3   0%                    intern
         419  12%                 - hotfuzz--filter-c
           2   0%                    cdr
         137   4%                 - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
         137   4%                  - complete-with-action
         137   4%                   - all-completions
          72   2%                    - #<byte-code-function 4C5>
          24   0%                     - #<byte-code-function 0D4>
          16   0%                      - commandp
           1   0%                       - interactive-form
           1   0%                        - oclosure-interactive-form
           1   0%                         - apply
           1   0%                          - #<byte-code-function 25B>
           1   0%                           - advice--cdr
           1   0%                              oclosure--get
           3   0%                      - command-completion-default-include-p
           2   0%                       - command-completion-using-modes-p
           1   0%                        - command-completion-with-modes-p
           1   0%                         - seq-intersection
           1   0%                          - seq-reduce
           1   0%                           - seq-empty-p
           1   0%                            - cl--generic-cache-miss
           1   0%                             - cl--generic-make-next-function
           1   0%                              - cl--generic-build-combined-method
           1   0%                               - cl-generic-combine-methods
           1   0%                                  cl--generic-standard-method-combination
           1   0%                        functionp
           3   0%                       version-to-list
         485  14% + command-execute
         125   3%   Automatic GC
          40   1% + timer-event-handler
          17   0% + redisplay_internal (C function)
Orderless cpu profile
        1613  87% - command-execute
        1612  87%  - byte-code
        1182  64%   - read-extended-command
        1182  64%    - read-extended-command-1
        1182  64%     - completing-read-default
        1182  64%      - apply
        1181  64%       - vertico--advice
        1181  64%        - apply
        1181  64%         - #<native-comp-function completing-read-default>
        1114  60%          - vertico--exhibit
        1114  60%           - vertico--update
        1093  59%            - vertico--recompute
        1092  59%             - vertico--filter-completions
        1092  59%              - completion-all-completions
        1092  59%               - apply
        1092  59%                - #<native-comp-function completion-all-completions>
        1092  59%                 - completion--nth-completion
        1091  59%                  - seq-some
        1091  59%                   - seq-do
        1091  59%                    - mapc
        1091  59%                     - #<byte-code-function DB1>
        1091  59%                      - #<byte-code-function D9C>
        1091  59%                       - eval
        1091  59%                        - let
        1091  59%                         - funcall
        1091  59%                          - #<byte-code-function 3EB>
        1036  56%                           - orderless-all-completions
        1032  56%                            - orderless--filter
         864  47%                             - help--symbol-completion-table
         856  46%                              - complete-with-action
         856  46%                               - all-completions
         218  11%                                - #<byte-code-function 366>
         170   9%                                 - #<byte-code-function F39>
         155   8%                                    make-closure
          13   0%                                  - cl-some
          12   0%                                   - #<byte-code-function 195>
           7   0%                                    - #<byte-code-function B7C>
           1   0%                                       keywordp
           1   0%                                       boundp
           1   0%                                      cl-find-class
           1   0%                                      facep
           4   0%                              - help-definition-prefixes
           4   0%                               - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_2>
           4   0%                                - radix-tree-insert
           4   0%                                 - radix-tree--insert
           4   0%                                  - radix-tree--insert
           4   0%                                   - radix-tree--insert
           4   0%                                    - radix-tree--insert
           4   0%                                     - radix-tree--insert
           4   0%                                      - radix-tree--insert
           4   0%                                       - radix-tree--insert
           3   0%                                        - radix-tree--insert
           3   0%                                         - radix-tree--insert
           3   0%                                          - radix-tree--insert
           3   0%                                           - radix-tree--insert
           3   0%                                            - radix-tree--insert
           3   0%                                             - radix-tree--insert
           3   0%                                              - radix-tree--insert
           3   0%                                               - radix-tree--insert
           3   0%                                                  radix-tree--insert
           1   0%                                intern
         168   9%                             - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
         168   9%                              - complete-with-action
         168   9%                               - all-completions
          15   0%                                - #<byte-code-function 896>
           6   0%                                 - #<byte-code-function 643>
           5   0%                                    commandp
           1   0%                                  - command-completion-default-include-p
           1   0%                                   - command-completion-using-modes-p
           1   0%                                    - provided-mode-derived-p
           1   0%                                       derived-mode-all-parents
           3   0%                            - orderless--compile
           3   0%                             - completion-boundaries
           3   0%                                help--symbol-completion-table
          55   2%                           - completion-basic-all-completions
          54   2%                            - completion-pcm--all-completions
          54   2%                             - help--symbol-completion-table
          54   2%                              - complete-with-action
          54   2%                                 all-completions
           1   0%                            - completion-boundaries
           1   0%                               help--symbol-completion-table
           1   0%                  - completion--styles
           1   0%                   - completion-metadata-get
           1   0%                    - apply
           1   0%                     - marginalia--completion-metadata-get
           1   0%                        marginalia-classify-by-prompt
           1   0%             - vertico-sort-history-length-alpha
           1   0%              - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>
           1   0%                 #<primitive-function string-lessp>
          20   1%            - redisplay
          17   0%               redisplay_internal (C function)
           1   0%              input-pending-p
          40   2%            redisplay_internal (C function)
           1   0%          - marginalia--minibuffer-setup
           1   0%             marginalia--cache-reset
           1   0%       - #<byte-code-function 1DE>
           1   0%        - #<byte-code-function BE6>
           1   0%         - apply
           1   0%          - #<byte-code-function F30>
           1   0%           - apply
           1   0%            - #<byte-code-function 5E7>
           1   0%             - #<byte-code-function BD5>
           1   0%              - apply
           1   0%               - #<byte-code-function F06>
           1   0%                - apply
           1   0%                 - #<byte-code-function 7D9>
           1   0%                  - #<byte-code-function BD0>
           1   0%                   - apply
           1   0%                    - #<byte-code-function F74>
           1   0%                       make-closure
         429  23%   - completing-read
         429  23%    - completing-read-default
         429  23%     - apply
         429  23%      - vertico--advice
         429  23%       - apply
         429  23%        - #<native-comp-function completing-read-default>
         180   9%         - vertico--exhibit
         139   7%          - vertico--update
          93   5%           - redisplay
          77   4%              redisplay_internal (C function)
          43   2%           - vertico--recompute
          41   2%            - vertico-sort-history-length-alpha
          23   1%             - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>
           9   0%                #<primitive-function string-lessp>
           5   0%               #<native-comp-function vertico--length-string<>
           2   0%              delete-consecutive-dups
           3   0%             input-pending-p
          35   1%          - vertico--arrange-candidates
          34   1%           - vertico--affixate
          32   1%            - #<byte-code-function BD6>
          32   1%             - apply
          32   1%              - marginalia--affixate
          32   1%               - marginalia--cached
          29   1%                - marginalia-annotate-symbol
          11   0%                   abbreviate-file-name
          10   0%                 - symbol-file
           5   0%                  - locate-library
           5   0%                     locate-file
           5   0%                 - marginalia--function-doc
           5   0%                  - documentation
           2   0%                   - function-documentation
           2   0%                    - apply
           2   0%                     - #<byte-code-function 153>
           2   0%                      - #<byte-code-function 71E>
           2   0%                         internal-subr-documentation
           2   0%                   - substitute-command-keys
           1   0%                      text-quoting-style
           1   0%                    - #<byte-code-function C3D>
           1   0%                       kill-buffer
           3   0%                 - documentation-property
           3   0%                  - substitute-command-keys
           3   0%                   - #<byte-code-function 1EA>
           3   0%                      kill-buffer
           3   0%                - marginalia-annotate-command
           3   0%                 - marginalia--function-doc
           3   0%                  - documentation
           3   0%                   - substitute-command-keys
           3   0%                    - #<byte-code-function 160>
           3   0%                     - kill-buffer
           1   0%                        tabspaces--local-buffer-p
           2   0%            - vertico--metadata-get
           2   0%             - completion-metadata-get
           2   0%              - apply
           2   0%               - marginalia--completion-metadata-get
           2   0%                - completion-metadata-get
           2   0%                 - apply
           2   0%                  - marginalia--completion-metadata-get
           2   0%                     marginalia-classify-by-prompt
           1   0%           - vertico--format-candidate
           1   0%            - apply
           1   0%             - #<byte-code-function 9E5>
           1   0%                vertico--display-string
           5   0%          - vertico--display-candidates
           5   0%           - vertico--resize-window
           4   0%              window-text-pixel-size
           1   0%            - default-line-height
           1   0%               default-font-height
           1   0%            vertico--prompt-selection
         134   7%           redisplay_internal (C function)
          12   0%         - minibuffer-error-function
          12   0%          - minibuffer-message
          12   0%           - sit-for
           6   0%              redisplay_internal (C function)
           1   0%   - format-prompt
           1   0%    - substitute-command-keys
           1   0%     - #<byte-code-function 685>
           1   0%      - kill-buffer
           1   0%         tabspaces--local-buffer-p
           1   0%  - funcall-interactively
           1   0%   - execute-extended-command
           1   0%    - command-execute
           1   0%     - funcall-interactively
           1   0%        profiler-start
         151   8% + timer-event-handler
          55   2%   Automatic GC
          14   0%   redisplay_internal (C function)
           1   0% + ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant