Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to reduce nrepl (ritz-repl) startup time?

Tags:

clojure

nrepl

I wasn't using ritz-nrepl before, and nrepl took around 10 sec which is long but still bearable since I don't restart it that often.

When I tried out ritz-repl, it took nearly 30s to boot, and consumes around 1.3G memory. This makes me reluctant to use it.

I even threw in a SSD hoping it can increase the speed, because I heard someone mention that he "hardly notice the lein repl startup time" using ubuntu + ssd. But I can't tell the difference myself between ssd and hdd. I don't know if I did something wrong or if its just a myth.

like image 937
LoveProgramming Avatar asked May 14 '13 22:05

LoveProgramming


1 Answers

There might be ways to reduce the startup time of an nrepl server that includes ritz but for the most part you will be stuck with at least the 10 seconds it takes to boot up the jvm on your machine. For me that is kind of an unacceptable delay when doing interactive development.

As an alternative you can use a smarter code reloading approach using the clojure.tools.namespace library. It basically keeps a dependency graph in memory and reloads only those namespaces that have been changed since you last refresh.

This will work out of the box for some but not all Clojure code. See the 'Preparing Your Application' section of the readme for more info on those edge cases to avoid.

Hope this helps!

like image 163
Dirk Geurs Avatar answered Sep 28 '22 04:09

Dirk Geurs