-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Emacs freezes when opening larger python files #703
Comments
50e430f appears to be the problem. It turned on |
@toctan Can you have a look at this? Perhaps your imenu tweaks have something to do with the slowness. |
This reverts commit 50e430f. See: bbatsov#703
@bbatsov I can't reproduce this. Even if I concat this file ten times into a python file over 10000 lines of code, it's still reasonably fast on my machine. @shofetim What version of Emacs are you using? Try to comment these lines of code below in (when (fboundp #'python-imenu-create-flat-index)
(setq-local imenu-create-index-function
#'python-imenu-create-flat-index)) |
@shofetim And does it make any difference if you turn off |
@shofetim Also, you may try to disable |
GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2014-06-16 on friesian
Though I have two machines, one running Debian Wheezy and the other Jessie and they both exhibit the same problem.
Still slow.
Still slow.
No improvement. |
@shofetim I suppose there is no issue with vanilla Emacs, so what if you do not enable |
So I tried with a clean checkout of prelude, no |
What about electric-indent-mode / electric-layout-mode added recently ? I had a feeling that it slow downs my emacs a bit. Maybe thats the issue ? Open prelude-python and seach for electric layout. Comment it out. (I writting from mobile, so sorry for not providing a code to disable it) -----Original Message-----
So I tried with a clean checkout of prelude, no Reply to this email directly or view it on GitHub: |
I finally reproduced the problem on an older mac. The problem is that which-function-mode relies onimenu, which is very slow with large python files because the python-mode create imenu index function is quite inefficient. With which-function-mode turned off, even with larger files, the navigation is quite smooth. |
I don't know what I'm talking about but is there a way that we can change the way python-mode creates imenu? Because as you said it is so slow and not usable, if we could somehow make it efficient it will solve both this problem and imenu issue. |
BTW I suggest instead of reverting 50e430f just disable which-function-mode for python mode |
* 'master' of github.com:bbatsov/prelude: Use gfm-mode instead of plain markdown-mode Switch the bindings for zop-to-char and zop-up-to-char Add the zop-to-char package Minor README tweak - Gittip is now Gratipay Warn if the modules file is missing Require imenu for prelude-goto-symbol `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead. Use K&R as default style Revert "[Fix bbatsov#782] Added magit-filenotify" Remove fringe size customization fix magit-filenotify error Added cython-mode to auto install list [Fix bbatsov#764] Removed redundant command [Fix bbatsov#783] Removed rainbow-mode from prelude-packages [Fix bbatsov#779] Moved elisp-slime-nav to elisp module [Fix bbatsov#782] Added magit-filenotify [Fix bbatsov#703] Disable which-fun-mode in python-mode Removed redundant guru-mode require package Don't create already existed directories Fix condition for "if prelude alredy installed" Reflect flx upstream variable name fix. autosave undo history Auto install protobuf-mode [Close bbatsov#547] Removed ack-and-a-half from prelude [Fix bbatsov#623] Restored kill-region defadvice [Fix bbatsov#753] Add a note for helm-M-x [Fix bbatsov#756] Added helm-ag to auto install list elixir module Update default opam commands to newest syntax Setup the new flycheck-ocaml syntax checker Update copyright years Install SLIME from MELPA helm-every-where takes responsibility for buffers-list Conflicts: modules/prelude-python.el
* 'master' of github.com:suutari-ai/prelude: personal, vendor: Remove persp-mode stuff personal: Update custom-safe-themes Use gfm-mode instead of plain markdown-mode Switch the bindings for zop-to-char and zop-up-to-char Add the zop-to-char package Minor README tweak - Gittip is now Gratipay Warn if the modules file is missing Require imenu for prelude-goto-symbol `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead. Use K&R as default style Revert "[Fix bbatsov#782] Added magit-filenotify" Remove fringe size customization fix magit-filenotify error Added cython-mode to auto install list [Fix bbatsov#764] Removed redundant command [Fix bbatsov#783] Removed rainbow-mode from prelude-packages [Fix bbatsov#779] Moved elisp-slime-nav to elisp module [Fix bbatsov#782] Added magit-filenotify [Fix bbatsov#703] Disable which-fun-mode in python-mode Removed redundant guru-mode require package Don't create already existed directories Fix condition for "if prelude alredy installed" Reflect flx upstream variable name fix. autosave undo history Auto install protobuf-mode [Close bbatsov#547] Removed ack-and-a-half from prelude [Fix bbatsov#623] Restored kill-region defadvice [Fix bbatsov#753] Add a note for helm-M-x [Fix bbatsov#756] Added helm-ag to auto install list elixir module Update default opam commands to newest syntax Setup the new flycheck-ocaml syntax checker Update copyright years Install SLIME from MELPA helm-every-where takes responsibility for buffers-list Conflicts: personal/custom.el
* 'master' of https://github.com/bbatsov/prelude: (38 commits) [Fix bbatsov#798] Prompt for confirmation in prelude-kill-other-buffers Use gfm-mode instead of plain markdown-mode Switch the bindings for zop-to-char and zop-up-to-char Add the zop-to-char package Minor README tweak - Gittip is now Gratipay Warn if the modules file is missing Require imenu for prelude-goto-symbol `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead. Use K&R as default style Revert "[Fix bbatsov#782] Added magit-filenotify" Remove fringe size customization fix magit-filenotify error Added cython-mode to auto install list [Fix bbatsov#764] Removed redundant command [Fix bbatsov#783] Removed rainbow-mode from prelude-packages [Fix bbatsov#779] Moved elisp-slime-nav to elisp module [Fix bbatsov#782] Added magit-filenotify [Fix bbatsov#703] Disable which-fun-mode in python-mode Removed redundant guru-mode require package Don't create already existed directories ...
* upstream/master: (57 commits) [Fix bbatsov#798] Prompt for confirmation in prelude-kill-other-buffers Use gfm-mode instead of plain markdown-mode Switch the bindings for zop-to-char and zop-up-to-char Add the zop-to-char package Minor README tweak - Gittip is now Gratipay Warn if the modules file is missing Require imenu for prelude-goto-symbol `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead. Use K&R as default style Revert "[Fix bbatsov#782] Added magit-filenotify" Remove fringe size customization fix magit-filenotify error Added cython-mode to auto install list [Fix bbatsov#764] Removed redundant command [Fix bbatsov#783] Removed rainbow-mode from prelude-packages [Fix bbatsov#779] Moved elisp-slime-nav to elisp module [Fix bbatsov#782] Added magit-filenotify [Fix bbatsov#703] Disable which-fun-mode in python-mode Removed redundant guru-mode require package Don't create already existed directories ...
* 'master' of github.com:bbatsov/prelude: (30 commits) [Fix bbatsov#798] Prompt for confirmation in prelude-kill-other-buffers Use gfm-mode instead of plain markdown-mode Switch the bindings for zop-to-char and zop-up-to-char Add the zop-to-char package Minor README tweak - Gittip is now Gratipay Warn if the modules file is missing Require imenu for prelude-goto-symbol `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead. Use K&R as default style Revert "[Fix bbatsov#782] Added magit-filenotify" Remove fringe size customization fix magit-filenotify error Added cython-mode to auto install list [Fix bbatsov#764] Removed redundant command [Fix bbatsov#783] Removed rainbow-mode from prelude-packages [Fix bbatsov#779] Moved elisp-slime-nav to elisp module [Fix bbatsov#782] Added magit-filenotify [Fix bbatsov#703] Disable which-fun-mode in python-mode Removed redundant guru-mode require package Don't create already existed directories ...
* upstream/master: (25 commits) Minor README tweak - Gittip is now Gratipay Warn if the modules file is missing Require imenu for prelude-goto-symbol `turn-on-eldoc-mode' is an obsolete command (as of 24.4); use `eldoc-mode' instead. Revert "[Fix bbatsov#782] Added magit-filenotify" Remove fringe size customization fix magit-filenotify error Added cython-mode to auto install list [Fix bbatsov#764] Removed redundant command [Fix bbatsov#783] Removed rainbow-mode from prelude-packages [Fix bbatsov#779] Moved elisp-slime-nav to elisp module [Fix bbatsov#782] Added magit-filenotify [Fix bbatsov#703] Disable which-fun-mode in python-mode Removed redundant guru-mode require package Don't create already existed directories Fix condition for "if prelude alredy installed" Reflect flx upstream variable name fix. autosave undo history Auto install protobuf-mode [Close bbatsov#547] Removed ack-and-a-half from prelude ...
For anybody that is still having issues that happens upon this thread, I realized the core of my problem was actually trying to edit over tramp. |
I had a similar issue (freeze at opening python file) in 26.1, until I disabled flyspell-prog-mode. |
When opening a (larger) python file in emacs, emacs will freeze for several seconds, to a minute, taking 100% CPU. It is barely noticeable on small files, but on something with more substance, like this it will hang for 30 seconds or so.
It appears to be a recent problem, I hadn't updated to prelude master in a month or so, and it was working before the update.
The text was updated successfully, but these errors were encountered: