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

lsp-describe-session is too slow #4551

Open
3 tasks done
eval-exec opened this issue Sep 19, 2024 · 1 comment
Open
3 tasks done

lsp-describe-session is too slow #4551

eval-exec opened this issue Sep 19, 2024 · 1 comment
Labels

Comments

@eval-exec
Copy link
Contributor

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

       49548  98% - command-execute
       49548  98%  - funcall-interactively
       49547  98%   - lsp-describe-session
       49498  98%    - widget-create
       49495  98%     - widget-default-create
       49413  98%      - tree-widget-value-create
       49285  98%       - widget-create-child-and-convert
       49021  97%        - widget-default-create
       48981  97%         - tree-widget-value-create
       48964  97%          - widget-create-child-and-convert
       48929  97%           - widget-default-create
       48774  97%            - tree-widget-value-create
       48738  97%             - widget-create-child-and-convert
       48625  96%              - widget-default-create
       15731  31%               - tree-widget-value-create
       10750  21%                - widget-create-child-and-convert
       10746  21%                 - tree-widget-icon-create
        9700  19%                  - widget-default-create
        1509   3%                   - widget-image-insert
        1220   2%                    - insert-image
           1   0%                       undo-auto--undoable-change
           2   0%                    - widget-image-find
           2   0%                     - display-graphic-p
           1   0%                        framep-on-display
         618   1%                   - substitute-command-keys
         419   0%                      generate-new-buffer
         166   0%                    - #<byte-code-function 6C9>
         166   0%                     - kill-buffer
           3   0%                      - replace-buffer-in-windows
           1   0%                         window-normalize-buffer
           1   0%                      buffer-string
           5   0%                     widget-specify-button
           2   0%                     widget-get-indirect
           1   0%                   - widget-clear-undo
           1   0%                      buffer-disable-undo
           1   0%                   - undo-auto--undoable-change
           1   0%                      undo-auto--boundary-ensure-timer
           2   0%                  - tree-widget-find-image
           1   0%                   - tree-widget-lookup-image
           1   0%                      file-readable-p
           3   0%                 - widget-convert
           2   0%                  - widget-member
           2   0%                   - widget-member
           2   0%                    - widget-member
           1   0%                       widget-member
        4974   9%                - widget-create-child
        4969   9%                 - widget-default-create
         652   1%                  - substitute-command-keys
         481   0%                     generate-new-buffer
         145   0%                   - #<byte-code-function 64B>
         143   0%                    - kill-buffer
           3   0%                       replace-buffer-in-windows
           1   0%                     text-quoting-style
           2   0%                    undo-auto--undoable-change
           1   0%                    widget-clear-undo
           3   0%                 - widget-copy
           1   0%                    identity
           2   0%                - widget-convert
           1   0%                 - widget-member
           1   0%                  - widget-member
           1   0%                     widget-member
           1   0%                  tree-widget-node
        7976  15%               - widget-image-insert
        6553  13%                - insert-image
           4   0%                 - undo-auto--undoable-change
           3   0%                    undo-auto--boundary-ensure-timer
           4   0%                - widget-image-find
           3   0%                 - display-graphic-p
           1   0%                    framep-on-display
        3331   6%               - substitute-command-keys
        2406   4%                  generate-new-buffer
         816   1%                - #<byte-code-function 147>
         812   1%                 - kill-buffer
          18   0%                  - replace-buffer-in-windows
           2   0%                     window-normalize-buffer
           3   0%                   buffer-name
           5   0%                  text-quoting-style
           5   0%               - widget-clear-undo
           1   0%                  buffer-disable-undo
           2   0%               - undo-auto--undoable-change
           1   0%                  undo-auto--boundary-ensure-timer
          73   0%              - tree-widget-icon-create
          65   0%               - widget-default-create
           8   0%                - substitute-command-keys
           6   0%                   generate-new-buffer
           2   0%                 - #<byte-code-function 22C>
           2   0%                    kill-buffer
           6   0%                - widget-image-insert
           5   0%                   insert-image
          27   0%              - widget-convert
           6   0%               - widget-member
           5   0%                - widget-member
           5   0%                 - widget-member
           3   0%                    widget-member
           4   0%                 widget-value-convert-widget
           3   0%                 tree-widget-convert-widget
          32   0%             - widget-create-child
          32   0%              - widget-default-create
           5   0%               - substitute-command-keys
           5   0%                  generate-new-buffer
          35   0%            - widget-image-insert
          28   0%               insert-image
          14   0%            - substitute-command-keys
           8   0%               generate-new-buffer
           5   0%             - #<byte-code-function 960>
           5   0%                kill-buffer
          34   0%           - tree-widget-icon-create
          32   0%            - widget-default-create
           4   0%             - substitute-command-keys
           2   0%                generate-new-buffer
           2   0%              - #<byte-code-function F28>
           2   0%               - kill-buffer
           1   0%                  replace-buffer-in-windows
           4   0%             - widget-image-insert
           3   0%                insert-image
           1   0%           - widget-convert
           1   0%            - tree-widget-convert-widget
           1   0%               widget-convert
          17   0%          - widget-create-child
          17   0%           - widget-default-create
           3   0%            - substitute-command-keys
           2   0%             - #<byte-code-function CC2>
           2   0%                kill-buffer
           1   0%               generate-new-buffer
           6   0%         - widget-image-insert
           4   0%            insert-image
           6   0%         - substitute-command-keys
           4   0%            generate-new-buffer
           2   0%          - #<byte-code-function 9A7>
           2   0%             kill-buffer
         263   0%        - tree-widget-icon-create
         240   0%         - widget-default-create
          40   0%          - widget-image-insert
          29   0%             insert-image
          16   0%          - substitute-command-keys
          12   0%             generate-new-buffer
           4   0%           - #<byte-code-function 759>
           4   0%              kill-buffer
           1   0%           undo-auto--undoable-change
           1   0%        - widget-convert
           1   0%         - tree-widget-convert-widget
           1   0%          - widget-convert
           1   0%           - tree-widget-convert-widget
           1   0%            - widget-convert
           1   0%             - widget-member
           1   0%                widget-member
         120   0%       - widget-create-child
         120   0%        - widget-default-create
          14   0%         - substitute-command-keys
           7   0%            generate-new-buffer
           6   0%          - #<byte-code-function 4F3>
           5   0%             kill-buffer
           1   0%             buffer-name
           8   0%       - tree-widget-find-image
           7   0%        - tree-widget-set-theme
           7   0%         - tree-widget-themes-path
           7   0%          - tree-widget--locate-sub-directory
           6   0%             file-accessible-directory-p
           1   0%             expand-file-name
           1   0%        - tree-widget-lookup-image
           1   0%           file-regular-p
           2   0%     - widget-convert
           2   0%      - tree-widget-convert-widget
           2   0%       - widget-convert
           2   0%        - tree-widget-convert-widget
           2   0%         - widget-convert
           2   0%          - tree-widget-convert-widget
           2   0%           - widget-convert
           2   0%            - tree-widget-convert-widget
           1   0%             - widget-convert
           1   0%              - tree-widget-convert-widget
           1   0%               - widget-convert
           1   0%                  tree-widget-convert-widget
          31   0%    - -map
          31   0%     - lsp--render-workspace
          30   0%        #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_397>
           4   0%    - lsp-browser-mode
           3   0%     - run-mode-hooks
           3   0%      - run-hooks
           2   0%         global-treesit-auto-mode-enable-in-buffer
           1   0%       - global-evil-mc-mode-enable-in-buffer
           1   0%        - evil-mc-mode
           1   0%         - evil-normalize-keymaps
           1   0%          - evil-state-keymaps
           1   0%           - evil-state-intercept-keymaps
           1   0%              evil-get-auxiliary-keymap
           1   0%     - special-mode
           1   0%      - use-local-map
           1   0%       - apply
           1   0%        - ad-Advice-use-local-map
           1   0%         - evil-normalize-keymaps
           1   0%          - evil-state-keymaps
           1   0%           - evil-state-keymaps
           1   0%            - evil-state-intercept-keymaps
           1   0%               evil-intercept-keymap-p
           2   0%    - lsp-workspace-root
           2   0%     - lsp-f-ancestor-of?
           2   0%      - lsp-f-same?
           1   0%         f-exists?
           1   0%         lsp-f-canonical
           2   0%    - pop-to-buffer
           2   0%     - display-buffer
           1   0%      - display-buffer-assq-regexp
           1   0%         buffer-match-p
           1   0%      - display-buffer--maybe-pop-up-frame-or-window
           1   0%       - display-buffer--maybe-pop-up-window
           1   0%        - display-buffer-pop-up-window
           1   0%         - window--display-buffer
           1   0%          - set-window-buffer
           1   0%           - apply
           1   0%              ad-Advice-set-window-buffer
           1   0%   - quit-window
           1   0%    - quit-restore-window
           1   0%       bury-buffer-internal
         361   0% - redisplay_internal (C function)
          19   0%  - eval
           7   0%   - tab-line-format
           5   0%    - tab-line-format-template
           4   0%     - #<byte-code-function B59>
           4   0%      - tab-line-tab-name-format-default
           4   0%       - apply
           4   0%        - tab-line-nerd-icons-add-icon-advice
           2   0%         - nerd-icons-icon-for-buffer
           2   0%          - nerd-icons--icon-info-for-buffer
           1   0%           - nerd-icons-icon-for-file
           1   0%              gethash
           1   0%           - nerd-icons-auto-mode-match?
           1   0%            - nerd-icons-match-to-alist
           1   0%             - cl-find-if
           1   0%              - cl-find
           1   0%               - cl-position
           1   0%                - cl--position
           1   0%                 - #<byte-code-function 024>
           1   0%                    string-match
           1   0%       tab-line-auto-hscroll
           1   0%    - tab-line-tabs-fixed-window-buffers
           1   0%       let*
           6   0%   - breadcrumb--header-line
           5   0%    - funcall
           3   0%     - breadcrumb-imenu-crumbs
           3   0%      - let
           3   0%       - which-function
           3   0%        - add-log-current-defun
           3   0%         - treesit-add-log-current-defun
           3   0%          - treesit-defun-at-point
           3   0%           - treesit-thing-at-point
           3   0%            - treesit-thing-at
           3   0%               treesit-node-at
           2   0%     - breadcrumb-project-crumbs
           2   0%      - breadcrumb--project-crumbs-1
           1   0%         project-current
           1   0%         breadcrumb--format-project-node
           1   0%    - cl-remove-if
           1   0%     - cl-remove
           1   0%      - seq-empty-p
           1   0%       - apply
           1   0%        - #<byte-code-function 75E>
           1   0%           seq-length
           4   0%   - mode--line-format-right-align
           4   0%    - string-pixel-width
           1   0%       #<byte-code-function B90>
           1   0%   - if
           1   0%      display-graphic-p
           1   0%   - minions--prominent-modes
           1   0%    - cl-remove-if-not
           1   0%       cl-remove
          11   0%  - tab-bar-make-keymap
          11   0%   - tab-bar-make-keymap-1
          11   0%    - tab-bar-format-list
          11   0%     - #<byte-code-function 8F9>
           6   0%      - project-mode-line-format
           6   0%       - project-name
           6   0%        - apply
           6   0%         - #<byte-code-function 9D8>
           6   0%          - apply
           6   0%           - #<byte-code-function 0B3>
           6   0%            - project--value-in-dir
           4   0%             - hack-dir-local-variables
           4   0%              - #<byte-code-function B50>
           4   0%               - hack-dir-local--get-variables
           3   0%                - dir-locals-find-file
           2   0%                 - locate-dominating-file
           1   0%                    dir-locals--all-files
           1   0%                    abbreviate-file-name
           1   0%                - dir-locals-collect-variables
           1   0%                   expand-file-name
           1   0%             - #<byte-code-function 742>
           1   0%                kill-buffer
           1   0%               generate-new-buffer
           3   0%      - tab-bar-format-align-right
           2   0%         string-pixel-width
           1   0%       - tab-bar-format-list
           1   0%        - #<byte-code-function E5A>
           1   0%         - keycast-tab-bar
           1   0%          - keycast--format
           1   0%           - format-spec
           1   0%              generate-new-buffer
           2   0%      - keycast-tab-bar
           2   0%       - keycast--format
           2   0%        - format-spec
           2   0%           generate-new-buffer
           1   0%  - redisplay--pre-redisplay-functions
           1   0%     window-buffer
           1   0%  - copilot--on-doc-focus
           1   0%   - jsonrpc-notify
           1   0%    - jsonrpc-connection-send
           1   0%     - apply
           1   0%      - #<byte-code-function F74>
           1   0%       - jsonrpc--event
           1   0%        - #<byte-code-function DAD>
           1   0%         - apply
           1   0%          - jsonrpc--log-event
           1   0%           - pp-to-string
           1   0%            - pp-fill
           1   0%             - pp--object
           1   0%                pp-fill
         254   0% - timer-event-handler
         253   0%  - apply
         183   0%   - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_9>
         183   0%      jit-lock-context-fontify
          33   0%   - persistent-scratch-save
          32   0%      persistent-scratch--save-buffers-state
           1   0%    - rename-file
           1   0%     - apply
           1   0%      - org-roam-db-autosync--rename-file-a
           1   0%       - org-roam-file-p
           1   0%        - org-roam-descendant-of-p
           1   0%           replace-regexp-in-string
          31   0%   - auto-revert-buffers
          31   0%    - apply
          31   0%     - auto-revert-buffers@buffer-list-filter
          31   0%      - #<native-comp-function auto-revert-buffers>
          27   0%       - auto-revert--buffer-candidates
          26   0%        - auto-revert--polled-buffers
          23   0%           #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_25>
           1   0%          #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_30>
           3   0%       - auto-revert--need-polling-p
           1   0%        - cl-some
           1   0%           #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_27>
           1   0%       - auto-revert-buffer
           1   0%          auto-revert-handler
           6   0%   - savehist-autosave
           6   0%    - savehist-save
           3   0%       prin1
           1   0%     - run-hooks
           1   0%      - evil--jumps-savehist-sync
           1   0%         #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12>
           1   0%     - savehist-printable
           1   0%        generate-new-buffer
           1   0%     - write-region
           1   0%      - make-lock-file-name
           1   0%         files--transform-file-name
           1   0%  - timer-activate-when-idle
           1   0%   - timer--activate
           1   0%      timer--time-less-p
          36   0% - mu4e--server-filter
          18   0%  - mu4e--info-handler
          18   0%   - mu4e--main-redraw
           8   0%    - mu4e--main-items
           8   0%     - #<byte-code-function F71>
           8   0%        mu4e-key-description
           6   0%    - mu4e--main-action
           6   0%       mu4e-key-description
           4   0%    - mu4e-main-mode
           4   0%     - run-mode-hooks
           4   0%      - run-hooks
           3   0%         global-treesit-auto-mode-enable-in-buffer
           1   0%       - evil-mode-enable-in-buffer
           1   0%        - evil-initialize
           1   0%         - evil-local-mode
           1   0%          - evil-initialize-state
           1   0%           - evil-change-state
           1   0%            - evil-normal-state
           1   0%             - evil-normalize-keymaps
           1   0%              - evil-state-keymaps
           1   0%               - evil-state-keymaps
           1   0%                - evil-state-auxiliary-keymaps
           1   0%                   evil-get-auxiliary-keymap
          18   0%  - mu4e--query-items-queries-handler
          18   0%   - apply
          18   0%    - run-hooks
          18   0%     - mu4e--main-redraw
           8   0%      - mu4e--main-items
           8   0%       - #<byte-code-function 99B>
           7   0%          mu4e-key-description
           1   0%        - mu4e--main-action
           1   0%         - mu4e-string-replace
           1   0%            replace-regexp-in-string
           5   0%      - mu4e--main-action
           5   0%         mu4e-key-description
           4   0%      - mu4e-main-mode
           3   0%       - run-mode-hooks
           3   0%        - run-hooks
           2   0%           global-treesit-auto-mode-enable-in-buffer
           1   0%         - global-evil-mc-mode-enable-in-buffer
           1   0%          - evil-mc-initialize
           1   0%           - evil-mc-mode
           1   0%            - evil-normalize-keymaps
           1   0%             - evil-state-keymaps
           1   0%              - evil-state-keymaps
           1   0%                 evil-state-overriding-keymaps
           1   0%       - special-mode
           1   0%        - use-local-map
           1   0%         - apply
           1   0%          - ad-Advice-use-local-map
           1   0%           - evil-normalize-keymaps
           1   0%            - evil-state-keymaps
           1   0%               evil-state-auxiliary-keymaps
           6   0% - mu4e--update-sentinel-func
           3   0%  - special-mode
           3   0%   - run-mode-hooks
           3   0%    - run-hooks
           3   0%       global-treesit-auto-mode-enable-in-buffer
           3   0%  - clone-buffer
           3   0%   - special-mode
           3   0%    - run-mode-hooks
           3   0%     - run-hooks
           2   0%        global-treesit-auto-mode-enable-in-buffer
           1   0%      - evil-mode-enable-in-buffer
           1   0%       - evil-initialize
           1   0%        - evil-local-mode
           1   0%         - evil-initialize-state
           1   0%          - evil-change-state
           1   0%           - evil-normal-state
           1   0%            - evil-normalize-keymaps
           1   0%             - evil-state-keymaps
           1   0%              - evil-state-intercept-keymaps
           1   0%                 evil-get-auxiliary-keymap
           3   0% - #<byte-code-function 3E0>
           1   0%    generate-new-buffer
           1   0%  - mapc
           1   0%   - #<byte-code-function F2E>
           1   0%    - lsp--parser-on-message
           1   0%     - #<byte-code-function B76>
           1   0%      - #<byte-code-function B67>
           1   0%       - #<byte-code-function B40>
           1   0%        - apply
           1   0%         - #<native-comp-function F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_460>
           1   0%          - lsp--position-to-point
           1   0%             lsp--line-character-to-point
           1   0%  - apply
           1   0%     insert
           3   0% - which-key--hide-popup
           3   0%  - which-key--hide-popup-ignore-command
           3   0%   - which-key--hide-buffer-side-window
           3   0%      quit-windows-on
           1   0% - help--append-keystrokes-help
           1   0%  - substitute-command-keys
           1   0%     generate-new-buffer
           0   0%   ...

Steps to reproduce

I have a project with 2000 files attached to lsp server, when I execute lsp-describe-session, its too slow

Expected behavior

should give me response in 1second

Which Language Server did you use?

rust

OS

Linux

Error callstack

No response

Anything else?

No response

@eval-exec eval-exec added the bug label Sep 19, 2024
@yyoncho
Copy link
Member

yyoncho commented Sep 23, 2024

see #764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants