• Stars
    star
    1,545
  • Rank 30,273 (Top 0.6 %)
  • Language
    Shell
  • License
    Eclipse Public Li...
  • Created over 12 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fast JVM launching without the hassle of persistent JVMs.

Drip is a launcher for the Java Virtual Machine that provides much faster startup times than the java command. The drip script is intended to be a drop-in replacement for the java command, only faster.

Drip is a single bash script and a little bit of C and Java code. It is intended to work with any JVM-based language and anywhere bash is available.

How does it work?

Unlike other tools intended to solve the JVM startup problem (e.g. Nailgun, Cake), Drip does not use a persistent JVM. There are many pitfalls to using a persistent JVM, which we discovered while working on the Cake build tool for Clojure. The main problem is that the state of the persistent JVM gets dirty over time, producing strange errors and requiring liberal use of cake kill whenever any error is encountered, just in case dirty state is the cause.

Instead of going down this road, Drip uses a different strategy. It keeps a fresh JVM spun up in reserve with the correct classpath and other JVM options so you can quickly connect and use it when needed, then throw it away. Drip hashes the JVM options and stores information about how to connect to the JVM in a directory with the hash value as its name.

Installation

The following instructions assume that ~/bin is on your $PATH. If that is not the case, you can substitute your favorite location.

Standalone — We recommend this to get started quickly.

curl -L https://raw.githubusercontent.com/ninjudd/drip/master/bin/drip > ~/bin/drip
chmod 755 ~/bin/drip

Checkout — If you want to hack on Drip or follow the latest development, this is the way to go.

git clone https://github.com/ninjudd/drip.git
cd drip && make prefix=~/bin install

Homebrew — This is a convenient way to brew drip on OS X.

brew install drip

Note: Installing brew requires gcc. Here are instructions for how to install it on OS X Mountain Lion.

Usage

You can call drip with the same arguments as java. Try it. The first time you execute drip with new arguments, it will take as long as a plain java command, because it has to spin up a JVM from scratch, but after that it will be fast.

For example, to start a Clojure repl with drip:

drip -cp clojure.jar clojure.main

The Drip JVM will eventually shut itself down if you never connect to it. The time limit defaults to four hours, but you can change this by setting the DRIP_SHUTDOWN environment variable before calling drip to set a timeout, in minutes:

DRIP_SHUTDOWN=30 drip -cp clojure.jar clojure.main

This creates a Clojure repl as usual, either by starting up a new one or connecting to a waiting JVM. But the JVM that is spun up to serve future requests with the same classpath will have a 30-minute timeout to deactivation.

JVM Language Integration

For more information about how to integrate Drip with your favorite JVM language, check out the wiki.

Advanced settings

Drip supports the following advanced settings.

Pre-Initialization

By default, Drip only loads your main class at startup, but you can tell Drip to run additional code at startup. This can be used to load classes or execute any initialization code you like. For a language like Clojure, which compiles code on-the-fly, this can be used to precompile commonly used code by requiring it.

To tell Drip how to initialize a new JVM, use the DRIP_INIT and DRIP_INIT_CLASS environment variables. DRIP_INIT should be a newline-separated list of args to be passed to the main() function of DRIP_INIT_CLASS. DRIP_INIT_CLASS defaults to the main class the JVM was started with.

System Properties

Sometimes, you need to set Java system properties, but you don't want them to be included in the JVM options used for hashing. In this case, use two dashes instead of one, and the options won't be passed to the JVM at startup, instead they will be passed at runtime. Keep in mind that any system properties passed this way will not be set during initialization.

Environment Variables

Drip passes all environment variables exported at runtime to the JVM and merges them into the map returned by System.getenv. Keep in mind that the environment isn't modified until we connect to the JVM; during initialization, the environment will be derived from the previous process that launched the spare JVM. 

License

Drip is licensed under the EPL Eclipse Public License. See LICENSE for details.

More Repositories

1

clojure-protobuf

Google protocol buffers wrapper for Clojure.
Clojure
217
star
2

cake

A tasty build tool for Clojure.
Clojure
171
star
3

jiraph

A graph database with pluggable backends, written in Clojure.
Clojure
137
star
4

classlojure

Advanced classloading for clojure.
Clojure
93
star
5

ring-async

Ring adapter supporting asynchronous responses using core.async channels.
Clojure
49
star
6

memcache

Advanced ruby memcache client
Ruby
48
star
7

eventual

Server-Sent Event and EventSource helpers for core.async.
Clojure
47
star
8

record_cache

Active Record caching and indexing in memcache. An alternative to cache_fu
Ruby
39
star
9

clojure-complete

Standalone Clojure completion library adapted from swank-clojure.
Clojure
35
star
10

wakeful

restful routing alternative for Clojure
Clojure
27
star
11

rupture

Ruby + Clojure
Ruby
19
star
12

lein-protobuf

Leiningen plugin for compiling google protocol buffers.
Clojure
18
star
13

action_flow

A state-machine inspired mixin for controllers that makes creating flows and wizards really simple.
Ruby
14
star
14

priority_queue

A simple priority queue for Ruby
Ruby
10
star
15

masai

Key-value database for Clojure with pluggable backends.
Clojure
10
star
16

method_cache

Powerful memcache-based memoization library for Ruby
Ruby
9
star
17

portal

A unified REPL and command server for Clojure.
Clojure
7
star
18

minisphinx

A simple Sphinx indexing library for Ruby.
Ruby
7
star
19

model_set

Easy manipulation of sets of ActiveRecord models
Ruby
7
star
20

ordered-collections

A Clojure set that maintains the insertion order of its contents.
Java
7
star
21

tokyocabinet

native tokyo cabinet libraries
C
7
star
22

active_document

Active models in Berkeley DB.
Ruby
6
star
23

cache_version

Store the version of any class for cache invalidation
Ruby
6
star
24

io

Clojure I/O utils.
Clojure
6
star
25

pg_queue

A ruby interface to skytools-pgq.
Ruby
5
star
26

deep_clonable

Deep cloning magic for Ruby objects.
Ruby
5
star
27

multi_table_inheritance

A Rails plugin that adds multi-table inheritance support using Postgres inheritance.
Ruby
5
star
28

deferrable

Simple extension for deferring method calls.
Ruby
5
star
29

github-uploader

Add file attachment capabilities to Github:issues and wikis.
JavaScript
4
star
30

retro

A protocol for revisioned transactions in Clojure.
Clojure
4
star
31

uncle

A lancet-inspired ant library for clojure.
Clojure
4
star
32

ordered_set

Like Set except it maintains the order of objects
Ruby
4
star
33

sqleton

a sql migration framework for clojure
Clojure
3
star
34

nested_transactions

Support for nested transactions in Rails (Postgres and MySQL)
Ruby
3
star
35

phonograph

A round-robin database, based on graphite's whisper.
Clojure
3
star
36

markdone-mode

Add todos to markdown-mode.
Emacs Lisp
3
star
37

grammer

Yammer notifications with Growl.
Clojure
3
star
38

icunicode

ICU Unicode Transliteration and Collation in Ruby.
C
3
star
39

replicator

Easy Postgres replication for Rails
Ruby
3
star
40

depot

A place for storing goods or motor vehicles.
Clojure
2
star
41

romp

A Stomp client library for Ruby.
Ruby
2
star
42

functor

Advanced functional stubbing in Ruby
2
star
43

meta

Ruby meta programming helpers.
Ruby
2
star
44

colorized

Cross application color theme generator inspired by Solarized.
Ruby
2
star
45

anti_object

Invert any object
Ruby
2
star
46

telegraph

A library that lets you build beautiful dashboards for telemetry and turntable.
JavaScript
2
star
47

ninjudd.github.com

HTML
1
star
48

test

test
1
star
49

try_git

1
star
50

resting

All I need is a place to lay my head.
JavaScript
1
star
51

cache_machine

Coming soon: A Rails engine for quick, convenient caching.
1
star
52

github-issues-plus

A simple github issues viewer that supports grouping by assignee and milestone.
Ruby
1
star
53

cake-marginalia

A Marginalia plugin to Cake
Clojure
1
star
54

yammerbot

Everyone's favorite Yammer irc bot.
Clojure
1
star
55

ego

Because your identity is important.
Clojure
1
star
56

ruminate

A map-reduce layer for jiraph.
Clojure
1
star