clojure-emacs/ac-nrepl

.emacs slowdown

memeplex opened this issue · 5 comments

I find that (require 'ac-nrepl) pretty slows down the loading of .emacs (probably because it's dragging clojure/cider related dependencies at an early stage). Maybe it's better to suggest a "hooked" alternative as the preferred way to configure ac-nrepl.

Thanks for taking the time to file this.

The preferred way to configure ac-nrepl is actually now to install ac-cider instead, because ac-nrepl is marked as deprecated! :-)

Hopefully switching over is an option, but in any case, no further development is likely to be done here.

For reference, the config I personally use for ac-cider is here: https://github.com/purcell/emacs.d/blob/master/lisp/init-clojure-cider.el

@purcell thank you for the heads up, I didn't know about ac-cider. I've already installed it.

Anyway, wouldn't it be preferable to hook ac-cider to cider-mode instead of directly requiring it at startup?

I'm still noticing a delay of about 1-2 seconds when requiring ac-cider at startup. My computer is slow, but the delay is significant in relative terms (the entire startup requires about 4 seconds, ac-cider included).

Have you tried relying on the autoloads instead? While the ac-cider (and ac-nrepl) example .emacs snippets include:

(require 'ac-cider)

they should work fine without that line if you've installed them via package.el.

So if you remove that line from your config, it will likely have the result that the delay will not happen until you first start working on clojure code.

Thank you for the tip!