Making a splash

One To Watch: Drip - a speedier launcher for the JVM

Last week, we couldn't help but notice the buzz on Twitter surrounding a young github project called Drip, designed to launch the JVM faster than the standard java command.

Our curiosity piqued, we got in touch with one of Drip’s developers, Justin Balthrop, to find out more about the project. “We started coding drip less than a week ago,” he told JAXenter. “So it is definitely still alpha. I didn't expect it to take off like this.”

The project was borne out of frustration with the slowness of  of Java command line tools. Their first attempt was the Clojure build tool Cake, which utilised a persistent JVM, but it was a “huge mistake”, says Balthrop. “Once we saw the speed, we were hooked and couldn't give it up, but keeping the state correct in a running JVM when code is changing is incredibly difficult.

“We wasted a lot of time making it pretty good, but the problem is you never really trust the persistent JVM. Your first reaction when something isn't working right is still to restart the entire JVM, just in case.”

So to solve this, Drip rapidly boots up (and then disposes of) JVMs - a simple but effective solution with the added benefit of working across languages. So far, the team have tested it with Java, Clojure, JRuby and Scala.

For something so basic, what is it about Drip that has attracted so much attention? Balthrop has a theory.

“I think there are a lot of people out there who want to develop for the JVM on the command line, not in a specialized IDE. With the rise of languages like Clojure and Scala, that number is only increasing. When you're writing software rather that just using it, you need a very short edit-compile-test cycle, and Java's slow startup time can get frustrating.”

Drip was released by a group called Flatland, whose website lists little more than its members names. It’s less of an organisation, more a communal label to put projects by Geni.com employees under.

“I can't explain why, but personally I'm just more inclined to use and get excited about a project that isn't an advertisement for the company that created it,” he says. “Hopefully, flatland will be a group of coders that grows over time and continues throughout our careers.”

The Flatland github account already has 30 public repos, the majority involving Clojure. Drip development is still ongoing, though, with new features still to come.

“The most important feature is getting Drip to work correctly with JLine,” says Balthrop. “We just released the ability to run initialization code when starting the JVM. This can increase speed a lot by loading classes or compiling Clojure code ahead of time. Of course, you have to be careful not to pre-load code that will change, but this can work well for build tools, because they have a lot of classes that don't change.

“We'd also like to add a hook so you can tell Drip how to check if the JVM is stale before accepting a connection,” he adds.

So, considering the attention Drip has garnered for simply reducing JVM startup times, does Balthrop reckon there’s any chance of Oracle upping their game and making the ‘java’ command faster?

“That'd be awesome, but I think we'd need a million more people using Drip before Oracle would take notice,” he says. “One can always hope though.”

You can download the Drip source from its github repo.
Elliot Bentley

What do you think?

JAX Magazine - 2014 - 03 Exclucively for iPad users JAX Magazine on Android

Comments

Latest opinions