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

nrepl.el needs huge amounts of time to do autocompletion #28

Closed
jjpe opened this issue Mar 23, 2013 · 7 comments
Closed

nrepl.el needs huge amounts of time to do autocompletion #28

jjpe opened this issue Mar 23, 2013 · 7 comments

Comments

@jjpe
Copy link

jjpe commented Mar 23, 2013

Using the latest nrepl.el and ac-nrepl packages from marmelade and with [org.clojure/tools.nrepl "0.2.2"] in my ~/.lein/profiles.clj, ac-nrepl will freeze whenever an autocomplete happens (triggered or automatic), freezing the nrepl/emacs UI along with it (without using extra CPU time I might add, and the rest of the system remains completely responsive).

The problem here is the 10+ secs it takes to do one autocomplete, not only making the feature defeat its own purpose, but effectively disabling proper typing in nrepl.el because of the automatic autocompletes while ac-nrepl is activated. This issue disappears on disabling ac-nrepl, prompting me to open an issue here as opposed to in nrepl.el.

The nrepl server is not on localhost, but on an android device I own, though that shouldn't be a problem as it never has been in the past.

In case it helps (TBH I don't really know if it's related), I found this entry in my Messages buffer when the latest AC was done:
Error in timer: (wrong-type-argument arrayp nil)

@sw1nn
Copy link

sw1nn commented Mar 24, 2013

Did you load the file? I see similar behaviour when I have run M-x nrepl-jack-in but not M-x nrepl-load-current-buffer, it seems to be the cause of the (wrong-type-argument arrayp nil) message.

@purcell
Copy link
Member

purcell commented Mar 24, 2013

What happens if you enable debug-on-error? Extra information here would be a big help.

@jjpe
Copy link
Author

jjpe commented Mar 24, 2013

sw1nn: Can't load the file using either nrepl-load-file or nrepl-load-current-buffer (I assume the latter is a shorthand for the former, with both using the same code), they result in a FileNotFoundException.
This is not weird to me as the nrepl server host (my android device) has no way of finding the sources on my desktop without some special code telling it where to find it, but I can paste the stacktrace nonetheless if you'd like.

Steve: It turns out debug-on-error was already enabled, but now I'm wondering why as I get the feeling that is not supposed to be the case.

A couple of other things that may be useful:

  1. I can cancel the AC every time, but it takes C-g C-g C-g (yes three of 'em) to do it, and of course it doesn't prevent the next AC from happening.
  2. I use Prelude (https://github.com/bbatsov/prelude), I don't know if that has any bearing on the configuration of ac-nrepl.

@jjpe
Copy link
Author

jjpe commented Mar 28, 2013

I tried the same thing with an updated emacs config, based on the most Prelude version.

  1. Triggering ac now takes about 6 seconds, which is much less than than the 10+ from earlier, but unfortunately still not really usable.
  2. debug-on-error is still set to t by default, though I still don't know why.

@purcell
Copy link
Member

purcell commented Mar 28, 2013

Sorry for not being on top of this right now; I'm a bit snowed under. I'll do my best to try to reproduce the issue locally, but if it's anything like #25, it might not be trivial to do so.

@jjpe
Copy link
Author

jjpe commented Mar 28, 2013

I figured it may be difficult to reproduce, that's why I'm trying to give as much useful debug info as I can. On that note, if there's anything else I can do please let me know.

EDIT: I just reached the conclusion that this delay only happens when the repl server is on my android device. Using the leiningen repl server, the issue does not present itself on my machine.

@purcell
Copy link
Member

purcell commented Jan 10, 2014

Going to go ahead and close this, since it doesn't seem to be either widespread or reproducible.

@purcell purcell closed this as completed Jan 10, 2014
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

3 participants