-
Notifications
You must be signed in to change notification settings - Fork 261
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
hanging when typing fast #234
Comments
Thank you for the report! I'm afraid I can not reproduce this behavior, so I'll have to make you jump through some shotgun-debugging stunts.
Thank you! |
Hi, Here are the results of the debugging: (length (elpy-rpc-get-completions)) gives the following: 193Without toggle-debug-on-error I get the following in messages: with toggle-debug-on-error I get the following in messages: Debug on Error enabled globally auto-complete mode switches off, and is no backtrace producedtoggle-debug-on-quit produces a backtrace, and emacs becomes very sluggish I have attached a print screen of what the backtrace looks like. I also I have also attached the result of the profiler-report. Let me know what else I can do. Thanks, On Sun, May 25, 2014 at 5:31 PM, Jorgen Schäfer [email protected]:
|
It seems that github does not include attachments sent via mail. Could you please compress the backtrace and send it (together with the profiling info) to contact (at) jorgenschaefer.de? Thank you! |
The backtrace picture I got looks really weird. Elpy sends a completion request. While that smells definitely fishy, I'm not convinced that's the cause of the problem. The last call in the backtrace I see there is the 25th RPC call, and there are 12 calls per cycle, which is 300 frames deep. The default value for `max-lisp-eval-depth' is 600, so there has to be something before that (bottom of the trace). And this wouldn't explain the 20s hang, either. You can try as a workaround to increase Elpy 1.5 will be using Company for the in-line completion, not auto-complete, so regardless of whether we figure out what is causing this, the problem should be fixed when that gets released. But the next major release is not due until August, so I'd be quite interested in fixing this even with auto-complete. :-) |
Ok, I was wrong, the bug is exactly that: Auto-complete starts, asks elpy to initialize, elpy sends a get_completions call. So far, so good and normal. Now, this call should finish, but instead, Emacs immediately (from the So this is two bugs. First, Second, because the call to initialize elpy never returns, auto-complete does not know that the call to init succeeded, so happily re-executes it (auto-complete.el:1569). Which results in an endless loop. Nice example of a race condition in concurrent programming! :-) Could you evaluate the following two statements and see if that fixes this problem for you? (defvar elpy--ac-init-lock nil)
(defun elpy--ac-init ()
"Initialize a completion.
This will call Python in the background and initialize
`elpy--ac-cache' when it returns."
(when (and (not elpy--ac-init-lock)
(not (eq (python-syntax-context-type)
'comment)))
(let ((elpy--ac-init-lock t))
(elpy-rpc-get-completions
(lambda (result)
(setq elpy--ac-cache nil)
(dolist (completion result)
(let ((name (car completion))
(doc (cadr completion)))
(when (not (string-prefix-p "_" name))
(push (cons (concat ac-prefix name)
doc)
elpy--ac-cache))))
(ac-start))
(lambda (err)
(message "Can't get completions: %s" err)))))) |
Hi, Those statements appear to fix the problem, thanks! I'll put them in my Thanks again, On Tue, May 27, 2014 at 6:51 PM, Jorgen Schäfer [email protected]:
|
Elpy should not be jerky even for large files because it runs most stuff asynchronously. The one thing it can't do asynchronously is serializing/deserializing large buffers, so if you are editing a large file, it can slow things down considerably (Elpy 1.5 will fix this). Then again, I have noticed that auto-complete can behave in very strange ways in certain Emacs configurations. It might be that this is hitting you. If you feel adventurous, you could try the current development version of Elpy (git clone the repo and add it to your |
The file is quite large - 3136 lines, 164k characters. I should probably On Wed, May 28, 2014 at 9:47 PM, Jorgen Schäfer [email protected]:
|
As there were no further updates, I assume this fixed the problem for you. I'll close this issue. If you experience any further problems, please do not hesitate to open a new one, though! |
Hi,
First of all, thank you very much for creating elpy - I find it extremely useful.
Unfortunately, I am running into some problems, that seem to be related to auto-complete, and typing speed. If I type the following as fast as I can (~80wpm):
for i in range(10):
emacs gets about half way through what I typed and hangs for ~20s, and eventually gives the following output in messages
error in process filter: turn-on-font-lock-if-desired: Lisp nesting exceeds
max-lisp-eval-depth' error in process filter: Lisp nesting exceeds
max-lisp-eval-depth'If I type slower, I don't seem to see this problem. Also, this problem only seems to occur when I am editing a file belonging to a larger module as opposed to a 'standalone' .py file.
I have ac-auto-start set to 3, it was worse with a lower number. ac-auto-show-menu is set to 0.4, and ac-quick-help-delay to 0.5 in elpy.el.
Here is the elpy related entry in init.el
(package-initialize)
(elpy-enable)
(elpy-use-ipython)
(setq python-shell-interpreter-args "--pylab --colors Linux")
(setq elpy-rpc-backend "jedi")
Here are the versions I'm using:
emacs 24.3.1, ubuntu 12.04, elpy 1.4.1
Thanks,
Shaun
The text was updated successfully, but these errors were encountered: