dCache/dcache — pull request #69 by paulmillar (2013-05-23 11:12:28+00:00)
Title: Various improvements to short-lived Java invocations

This patch adds several features to improve responsiveness
for various short-lived java invocations and in particular
the chimera-cli command.

The '-client' option is used (sporadically) as a hint to
the JVM not to waste time optimising the byte-code as much
of the code won't be run multiple times. This option only has
an effect on 32-bit JVMs. This patch adds '-client' to the
places where it's missing and adds the '-XX:+TieredCompilation
-XX:TieredStopAtLevel=1' options that have the same effect for
64-bit JVMs.

For short-lived tasks, much of the time is spent processing
the classes. By limiting the classpath to only the jar files
that are needed, less time is taken. This patch adds support
for this and applies it to the chimera-cli command.

A considerable fraction of the time processing a class involves
verifying certain aspects of the byte-code. If we trust the
Java compiler and the source of the code, we can choose to
side-step this verification by adding the classes to the
bootstrap-classpath. This patch does this for the
chimera-cli command.

The chimera-cli creates a BoneCP database pool. The current
options are not optimal. This patch updates them.

The effect of these changes were tested by timing how long it
takes to run "chimera-cli ls /" 10 times (discarding output)
using the system-test deployment. This is then repeated 5
times and the mean and std. deviation is calculated.

The initial time to run "chimera-cli ls /" on my laptop is
(2.99 +/- 0.03) s

Each of the improvements had the following improvements:

-client -XX:+TieredCompilat... (0.64 +/- 0.07) s
Limiting jars on classpath (0.44 +/- 0.03) s
Using boot-classpath (0.45 +/- 0.02) s
Updated BoneCP configuration (0.07 +/- 0.02) s

Total improvement (1.56 +/- 0.03) s

Time to run "chimera-cli ls /" with all improvements is
(1.43 +/- 0.01) s

Acked-by: Tigran Mkrtchyan
Acked-by: Gerd Behrmann
Patch: http://rb.dcache.org/r/5584/
Target: master
Request: 2.6