Is there a way to reduce the startup time of nrepl (ritz-repl)?

I didn’t use ritz-nrepl before, and nrepl took about 10 seconds, which is long, but still bearable, since I do not restart it often.

When I tried ritz-repl, it took almost 30 seconds to load and consumed about 1.3 GB of memory. It makes me reluctant to use it.

I even dropped the SSD, hoping it could increase speed, because I heard someone mention that it “almost doesn't notice the start time of the replica” using ubuntu + ssd. But I can not tell the difference between ssd and hdd. I don’t know if I did something wrong or is it just a myth.

+6
source share
1 answer

There may be ways to reduce the startup time of the nrepl server, which includes ritz, but for the most part you will be stuck in at least 10 seconds to download jvm on your computer. For me, this is a kind of unacceptable delay in interactive development.

Alternatively, you can use a more accurate approach to reloading code using the clojure.tools.namespace library . It basically stores the dependency graph in memory and reloads only those namespaces that have changed since the last update.

This will work out of the box for some, but not all Clojure code. See the “Preparing Your Application” section of the readme file for more information about these extreme cases to avoid this.

Hope this helps!

+1
source

Source: https://habr.com/ru/post/945019/


All Articles