Closed zeronone closed 7 years ago
My emacs was being slow. I mostly noticed it in elm mode. I was on the railwaycat brew emacs. Last night I switched to brew emacs-plus. And for some reason it's faster now. I don't know if it's just from restarting emacs, which I go for long stretches of time without doing.
How did you do the profiling?
I post because we have similar systems.
(auto-completion osx emacs-lisp git markdown org elixir elm html gtags yaml
(javascript :variables js2-mode-show-strict-warnings nil)
react shell-scripts
(shell :variables shell-default-position 'right shell-default-shell 'ansi-term)
syntax-checking)
@laduke You can start the profile with M-x profiler-start
and perform the actions (in my case, several dd
, dw
commands); and get the report with M-x profiler-report
.
The problem was solved for me after installing emacs-plus
from homebrew/d12frosted
. So I will close the issue.
Nevertheless the problem persists when used with emacs --daemon && emacsclient -c
I ran into this issue periodically in the past--it would go away after restarting emacs with <leader> q r
(and reappear if I quit with, e.g., <leader> q q
), which suggests it could have been layout-related, maybe? In any case, I haven't run into this issue again in quite a while, but I'm not sure why. Additionally, I vaguely remember it disappearing after I'd fix seemingly-unrelated, minor errors in my user-config
(non-breaking errors that showed up in the *Messages*
buffer). I never quite figured it out. For what it's worth, here's my system information (though, again, I haven't run into this issue in a while):
((auto-completion :variables auto-completion-tab-key-behavior nil auto-completion-return-key-behavior nil auto-completion-enable-sort-by-usage t)
better-defaults emacs-lisp git markdown
(org :variables org-bullets-bullet-list
'("■" "◆" "◉" "✸")
org-enable-github-support t org-projectile-file "TODOs.org")
(shell :variables shell-enable-smart-eshell t)
spell-checking syntax-checking version-control ruby
(colors :variables colors-colorize-identifiers 'all)
(mu4e :variables mu4e-installation-path "~/.emacs.d/layers/+email/")
shell-scripts vimscript themes-megapack pdf-tools
(ranger :variables ranger-show-preview t ranger-show-hidden t ranger-cleanup-on-disable t ranger-show-literal nil ranger-ignored-extensions
'("mkv" "iso" "mp4" "avi")
ranger-override-dired t)
ivy extra-langs javascript fasd ipython-notebook
(python :variables python-enable-yapf-format-on-save t python-sort-imports-on-save t python-test-runner 'pytest)
osx dash bibtex evil-cleverparens theming nlinum operators github)
@zeronone this may actually be symptomatic of a relatively pernicious issue: your $SHELL
's non-interactive configuration may be taking that long to run.
For example, with fish (I don't remember the particulars of bash/zsh interactive vs. non-interactive configuration files), adding sleep 5
to my config.fish
reproduces this issue (each call to, e.g., dd
takes 5+ seconds). Again with fish, the solution is to wrap sleep 5
(or, in practice, anything in your config.fish
that you only need in interactive shells) in an if status is-interactive
check.
I'm not absolutely positive the behavior I've just described is expected behavior: while I don't know a bunch about this area of programming, this was definitely surprising to me (why would evil/emacs need to call non-interactive shell configuration every time I, e.g., attempt to delete a line with dd
?).
@braham-snyder I guess you found the root cause. I removed the following line from ~/.zshenv
and everything is fast again (when I run emacs with emacs --daemon && emacsclient -c
).
NVM_DIR=$HOME/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
But I don't know why Evil commands get to run this file. Maybe related to exec-path-from-shell
.
If you have omf
, oh-my-fish, installed. Then the solution to this issue is to wrap the file ~/.config/fish/omf.fish
in if status --is-interactive
like so:
if status --is-interactive
# Path to Oh My Fish install.
set -q XDG_DATA_HOME
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
or set -gx OMF_PATH "$HOME/.local/share/omf"
# Load Oh My Fish configuration.
source $OMF_PATH/init.fish
end
I think @braham-snyder had the right idea to fix this issue (if you have fish shell installed).
I have been suffered for the same issue. The problem was reproduced with: CentOS Linux release 7.4.1708, GNU Emacs 24.3.1, evil 20160818, mac 10.12.6 (16G29), GNU Emacs 25.1.1, evil 20160827
Be sure to check whether you're using evil-goggles. I spent 30 minutes - including finding this issue and messing with my fish shell - only to learn I was using a package specifically designed to slow and make visible file changes triggered by evil bindings! 🤦
Delete commands such as
dw
,dd
are very slow (p
etc show a similar lag)Profiling several consecutive
dw
, anddd
commands (in normal vim mode) show the following. It seems the helm command is triggered in between and takes a long time.System Info :computer: