Wednesday, November 18, 2015

CIDER slows down Leiningen startup. Here is how to fix that.

Official CIDER documentation recommends putting CIDER into user's profile.
{:user {:plugins [[cider/cider-nrepl "0.9.1"]]}}

If you don't need to have it available all the time, but only when you run lein repl, you can move it into :repl profile.
{:repl {:plugins [[cider/cider-nrepl "0.9.1"]]}}
After this, startup time of non-REPL tasks will be much faster (e.g. 2 seconds vs 8 seconds for `lein help` on my machine).

5 comments:

  1. Wow. I did this and it cut my lein start time from 9.4s to 5.7s.

    Thanks!

    ReplyDelete
  2. So after doing this, cider-jack-in inside emacs no longer works :-(. I assumed that it would use the :repl profile, but maybe it doesn't?

    ReplyDelete
    Replies
    1. cider-jack-in works fine on my machine. Are you sure that You have correct stuff in ~/.lein/profiles.clj? Can You post it somewhere? It should (at least) contain that one line mentioned in my post.

      Delete
  3. Didn't know about the `:repl` profile. I'll update the docs.

    ReplyDelete
  4. Wow! This is the coolest! Thank you so much.

    ReplyDelete