1

When I open for the first time Treemacs into a project (not only the first time ever, but every time I open the project) it can take some minutes to load, blocking Emacs. This is the CPU profile:

- command-execute                                  437  76%
 - call-interactively                              436  76%
  - funcall-interactively                          273  47%
   - +treemacs/toggle                              261  45%
    - require                                      227  39%
     - byte-code                                   201  35%
      - require                                    130  22%
       - byte-code                                 124  21%
        - require                                   89  15%
         - byte-code                                85  14%
          - require                                 68  11%
           - byte-code                              66  11%
            + require                               49   8%
           + do-after-load-evaluation                1   0%
         + defconst                                  1   0%
        + eval-after-load                            6   1%
          treemacs-join-path                         1   0%
        + custom-declare-face                        1   0%
       + do-after-load-evaluation                    1   0%
     + do-after-load-evaluation                     25   4%
     + provide                                       1   0%
    + let*                                          28   4%
   + execute-extended-command                       12   2%
  + byte-code                                      163  28%
- ...                                              133  23%
   Automatic GC                                    128  22%
 + while                                             3   0%
 + #<compiled 0x1ff845295709>                        1   0%
 + evil-local-mode                                   1   0%
+ redisplay_internal (C function)                    1   0%
  treemacs--post-command                             1   0%

I cannot guess what it could be.

NickD
  • 27,023
  • 3
  • 23
  • 42
DPD-
  • 251
  • 1
  • 9
  • 1
    There is no function named `+treemacs/toggle` in the stock version of `treemacs`: https://github.com/Alexander-Miller/treemacs . Forum participants my not know what that function is. You have not provided the percentages that are displayed in the profiler that would enable forum participants to see which areas require more work to be done by Emacs. You may wish to consider temporarily removing the relevant byte-compiled files and restarting Emacs and running the profiler again so that you see more than just "byte-code", which is not particularly helpful to trace the code to its source. – lawlist Sep 22 '21 at 13:46
  • For the function it's Doom Emacs: https://github.com/hlissner/doom-emacs/blob/develop/modules/ui/treemacs/autoload.el For "You may wish to consider temporarily removing the relevant byte-compiled files and restarting Emacs" I don't know how to do – DPD- Sep 22 '21 at 14:27
  • 1
    @lawlist: the percentages are off to the right - you have to scroll. But they are not particularly enlightening IMO, probably for the reasons you have identified. – NickD Sep 23 '21 at 17:46
  • 1
    I edited to get rid of white space and bring the percentages into the visible region: no scrolling required. – NickD Sep 23 '21 at 17:51

0 Answers0