This page describes how to speed up execution of DSpace command-line scripts (class launcher) using Nailgun by Martian Software, Inc.
The reason why even the simplest DSpace command-line scripts usually take several seconds to run is because the Java class launcher has to create a new JVM instance every time it's run. Nailgun has a client/server architecture and implements a very lightweight JVM in the server part, which keeps running as a service and therefore doesn't have to be started up every time. You then use the command line nailgun client (ng) to connect to it to launch a class, which is considerably faster than starting up the JVM.
Download and build the nailgun client and server (this assumes that dspace is installed in /dspace, that you have gcc installed and that you can run binaries from ~/bin):
Start the nailgun server and add DSpace to its classpath:
Run the client:
After you're finished running multiple invocations of the DSpace command-line scripts, you can stop the Nailgun server: