My setup is usually: - Eclipse with Counterclockwise plugin - Keep an open, running REPL at all times - Reload namespaces when necessary (Ctrl+Alt+L) - Run tests with clojure.test from the REPL
This avoids the startup overhead most of the time - I usually only use the Maven / leiningen command line when doing a build (in this case, a new JVM instance is probably desirable anyway for the purpose of testing in a fresh environment). Note that the problem is actually the Clojure startup time, *not* the JVM startup. JVM starts up in about 0.1sec on my machine. The rest of the time is spend loading Clojure code, compiling all the core namespaces etc. On Wednesday, 5 June 2013 04:51:10 UTC+8, David Pollak wrote: > > Folks, > > I've been doing Clojure coding for the last couple of weeks and really > love the language... and the community is fantastic. > > But the development cycle is slow. > > I'm coming from mostly Scala and a little Java. > > In Java, there's no REPL or anything... but the compile/test cycle is very > fast. So, I can make a few changes to code, type "mvn test" and see the > results typically in less than 2 seconds (my MacBook Pro and my Linux > desktop). > > In Scala, the compile cycles are slower than in Java because the Scala > compiler is doing a whole ton more. But in sbt (Simple [ha ha] Built Tool), > one is always building/testing in the same JVM instance so the JVM is > warmed up. A "change code and run tests" cycle is typically as fast as it > is in Java. For example, Changing something significant in the > net.liftweb.util package and doing a recompile and test takes about 9 > seconds. This is running > 450 tests. > > My Clojure development cycle is much slower. On my MacBook Pro (3rd gen i7 > quadcore processor, 16GB of ram), each time I make a change and re-run the > test for Plugh ( https://github.com/projectplugh/plugh ) it takes about > 20 second and there are only 4 tests. On my desktop Linux box (i7-3770 with > 32gb of RAM) it takes about 4 seconds to run the 4 tests. I also ran stuff > on a very old ThinkPad (core 2 duo with 4GB ram running Linux Mint 15) and > the test cycle takes 12 second. > > So... the questions: > > * Is there a faster cycle than to change code, change tests and type "lein > test" to see the results? > * Is there a way to keep everything in a hot JVM (I've done a little > research on Nailgun... but it seems to be out of vogue) so there's no JVM > start-up penalty? > * Is there a reason for the huge disparity between my MacBook Pro and my > desktop box? > > Thanks, > > David > > > -- > Telegram, Simply Beautiful CMS https://telegr.am > Lift, the simply functional web framework http://liftweb.net > Follow me: http://twitter.com/dpp > Blog: http://goodstuff.im > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.