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

dante-status being called thousands of times over a few seconds #32

Closed
puffnfresh opened this issue Jul 27, 2017 · 3 comments
Closed

dante-status being called thousands of times over a few seconds #32

puffnfresh opened this issue Jul 27, 2017 · 3 comments

Comments

@puffnfresh
Copy link
Contributor

I sometimes open a new Haskell file outside of a project. When I do this Dante gets very slow and Emacs sits at about 100% CPU whenever I edit the buffer.

I found that Emacs supports profiling via (profiler-start) then I did a (profiler-report) to get:

- redisplay_internal (C function)                                7700  46%
 - eval                                                          7158  42%
  - spaceline-ml-main                                            6837  41%
   - mapcar                                                      6754  40%
    - #<compiled 0x24da0c3>                                      6751  40%
     - format-mode-line                                          6741  40%
      - eval                                                     6741  40%
       - concat                                                  6741  40%
        - dante-status                                           6741  40%
         - dante-state                                           4555  27%
          - dante-buffer-p                                       4555  27%
           - dante-buffer-name                                   4555  27%
            - dante-project-root                                 4555  27%
             - dante-cabal-find-file                             4553  27%
              - dante-cabal-find-pkg-desc                        4343  26%
               + directory-files                                 2516  15%
               + cl-remove-if-not                                   1   0%
              + file-attributes                                    19   0%
             + dante-buffer-file-name                               1   0%
         - dante-buffer-p                                        2186  13%
          + dante-buffer-name                                    2186  13%
     + s-trim                                                       2   0%

So I guess the root cause is that Dante is trying to get a .cabal file over and over and not finding one. Can we make Dante not spike to 100% whenever I edit a file without a .cabal project?

@puffnfresh
Copy link
Contributor Author

echo > x.cabal

Is enough to make Dante start working. Doesn't even need content.

@puffnfresh
Copy link
Contributor Author

Looks like we just need to set these fields so that Dante stops trying to populate them:

2017-07-27-131714_329x63_scrot

@jyp
Copy link
Owner

jyp commented Aug 2, 2017

Nice report; I've cached dante-project-root, let me know if this fixes the problem.

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

2 participants