Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My repl starts in about a second... maybe it’s because I’m using cursive


Whatever your setup, there is no way you are starting a JVM from scratch and then loading a Clojure REPL in one second. I promise you that is not happening.


Have you tried the new clj command line tool from Clojure themselves?

  $ time clj -e '(System/exit 0)'
  clj -e '(System/exit 0)'  1.60s user 0.07s system 198% cpu 0.839 total
It takes about 2 seconds to start for me.

In this case I suspect cursive is fast because:

* You have a JVM loaded in the form of IntelliJ * You only need to start Clojure inside that JVM (which is reduced from the time clj takes!)

So 1 second is a reasonable time from IntelliJ=>Clojure. 2 seconds is reasonable for Nothing=>Clojure.


Its not 2 seconds. With the time command, you have to look at the elapsed time. Clojure does parallel execution, that's why you see CPU at 198%. So the user and sys time are the sum of the time on each cores.

So the actual time was 0.839s.

Which means Clojure 1.9 on your computer boots and shutdowns its repl in under a second.


I'm lost. I have Java 9 and the latest Clojure 1.9 plus Leiningen. No 'clj' in my PATH. Where does this new command live?


See the getting started guide on how to install the CLI. https://clojure.org/guides/getting_started


Blame Clojure's implementation.

The (Clojure) "JVM Slow Startup Time" Myth

http://blog.ndk.io/jvm-slow-startup.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: