gzz.util
Class Bench

java.lang.Object
  |
  +--gzz.util.Bench

public class Bench
extends java.lang.Object

Test speeds of various simple java operations, provide a generic simple speed-test framework. The parameters that can be passed are

-min s
The minimum number of seconds that each benchmark should physically run. In order to avoid noise, each benchmark's number of times to run is successively increased until the whole benchmark runs at least this many seconds. E.g. -min 2.3 = run at least 2.3 seconds


Field Summary
static java.lang.String rcsid
           
 
Constructor Summary
Bench(java.lang.String[] argv)
          Parse the arguments for the benchmark, described above.
 
Method Summary
static void main(java.lang.String[] argv)
           
 void run(java.lang.Object[] tests)
          Run the given tests, time them and print out the results.
 void run(java.lang.Object[] tests, java.lang.String prefix, java.lang.String level)
           
 void runTest(java.lang.String s, java.lang.Runnable r, java.lang.String level)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Constructor Detail

Bench

public Bench(java.lang.String[] argv)
Parse the arguments for the benchmark, described above.

Method Detail

runTest

public void runTest(java.lang.String s,
                    java.lang.Runnable r,
                    java.lang.String level)

run

public void run(java.lang.Object[] tests)
Run the given tests, time them and print out the results. Each test should be relatively fast to execute.

Parameters:
tests - Triplets of String, String, Runnable: first string is a unique ID for the test, second string a human-readable explanation (without newlines) and the Runnable is the test itself.

run

public void run(java.lang.Object[] tests,
                java.lang.String prefix,
                java.lang.String level)

main

public static void main(java.lang.String[] argv)