Open chendsh opened 5 years ago
Had a similar issue with Emacs on Windows. I was able to resolve the issue by disabling eldoc-mode
in haskell-mode
.
As you can see in your profile there is something horribly wrong happening in Emacs when running eldoc-minibuffer-message
. I am not sure if this is not a bug in Emacs itself, but haskell-mode
is using eldoc
to display the type of the symbol at point in the minibuffer.
You can disable eldoc
by adding the following lines to your configuration:
;; disable eldoc in haskell-mode
(add-hook 'haskell-mode-hook #'(lambda () (eldoc-mode -1))
Same problem with Emacs on Windows, same solution that @jakzale wrote. Thank you for the hint!
What I can see is that eldoc works properly before I load the file to process (C-c C-l), but font faces are plain. After I load the file to the process the font faces of eldoc in the minibuffer changes to have more colors and it slows down extremely.
I have no similar problem with Emacs on Linux.
Which GHC versions / builds for Windows are y'all using?
Thanks. I don't have access to a Windows machine to try this on, and I'm not sure if any of the other repo contributors are following these issues. It might help gathering information to use profiler-start
/profiler-report
either side of triggering the slow code, but that sometimes does not show up delays due to async communication with processes. The other thing you could try is to set debug-on-quit
and then hit C-g
while Emacs is unresponsive: this (usually) produces a backtrace which can contain useful information.
I am trying a little piece of haskell code like this in a file (test.hs) using haskell-mode.
But each time when I moved the cursor to 5 just after infixr, emacs became very slow and the CPU usage went high. Looks like haskell-mode was trying to resolve this 5 by contacting GHC interactively and finally displayed in minibuffer something like this;
5 :: Num p => p
Here is the cpu profile of emacs. (sometimes it reaches 89% etc., not only 57% shown here)
I am using emacs 26.2 for windows and installed haskell-mode-20190417.309 from melpa.
And here is the configuration for it.
And this is the only external package I installed.
ghc version; The Glorious Glasgow Haskell Compilation System, version 8.6.3