|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectN08_Part2_DataStructureAccess
public class N08_Part2_DataStructureAccess
For the article Robust Java benchmarking, Part 2: Statistics And solutions, contains the code relevant to Figure 3, Figure 4, Figure 5, Listing 2, and Listing 3.
Field Summary | |
---|---|
protected static String |
class_key
|
protected static List<String> |
keysLegal
Specifies all the switch keys which can legally appear as command line arguments to main . |
protected static String |
mode_key
|
protected static String |
pathPrefix_key
|
protected static String |
size_key
|
Constructor Summary | |
---|---|
N08_Part2_DataStructureAccess()
|
Method Summary | |
---|---|
protected static N08_Part2_DataStructureAccess.TaskAbstract |
getTask(String className,
int size,
N08_Part2_DataStructureAccess.Mode mode)
|
static void |
main(String[] args)
Entry point to the functionality offered by this class. |
protected static int[] |
makeGeometricSeries(int start,
int end,
int n)
Generates the double-valued geometric series [start, start * r, start * r^2, ..., start * r^(n-1)] . |
protected static void |
outputFull(String className,
N08_Part2_DataStructureAccess.Mode mode,
int size,
String pathPrefix,
bb.util.Benchmark benchmark,
String result)
Writes the full results to a file. |
protected static void |
outputMeanOnly(String className,
N08_Part2_DataStructureAccess.Mode mode,
int size,
String pathPrefix,
bb.util.Benchmark benchmark,
String result)
Writes the mean-only results to a file that is suitable for loading into a spreadsheet for graphing. |
protected static void |
resultsToFile(String className,
int size,
N08_Part2_DataStructureAccess.Mode mode,
String pathPrefix,
bb.util.Benchmark benchmark,
String result)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String class_key
protected static final String mode_key
protected static final String size_key
protected static final String pathPrefix_key
protected static final List<String> keysLegal
main
.
Constructor Detail |
---|
public N08_Part2_DataStructureAccess()
Method Detail |
---|
public static void main(String[] args) throws Exception
Results on 2008-03-27 on my 2.2 GHz Intel Core 2 Duo E4500 machine (server jvm) are in the
../results/N08_Part2_DataStructureAccess_Desktop_XXX.txt
series of files.
Results on 2008-03-27 on my 1.167 GHz SPARC-Enterprise-T5220 machine (server jvm) are in the
../results/N08_Part2_DataStructureAccess_N2_XXX.txt
series of files.
Note: the N2 results are CPU times, not elapsed times (since the tests are all single threaded and Solaris supports this so well)
The files above contain the full Benchmark reports.
Edited versions of the relevant data (i.e. just the means) of all of the above results,
plus all of the associated Figures in the article, are found in the spreadsheet
../results/N08_Part2_DataStructureAccess.xls
.
Results on 2009-12-20 on my 2.5 GHz Intel Xeon E5420 machine (server jvm) are in the
.../results/newPostArticleResults/dataStructureAccess directory.
args
- must be non-null and have exactly 8 elements;
these 8 elements must consist of these 4 command line switches (name/value pairs);
the switches may be in any order:
-class [the name of one of the task inner classes e.g. ArrayAccess],
-mode [either sequential or random],
-size [the number of elements in the data structure, as an int],
-pathPrefix [valid file system path prefix; the final part of the file name will be generated by this class]
Exception
- (or some subclass) if any problem happens
protected static N08_Part2_DataStructureAccess.TaskAbstract getTask(String className, int size, N08_Part2_DataStructureAccess.Mode mode) throws Exception
Exception
protected static void resultsToFile(String className, int size, N08_Part2_DataStructureAccess.Mode mode, String pathPrefix, bb.util.Benchmark benchmark, String result) throws Exception
Exception
protected static void outputMeanOnly(String className, N08_Part2_DataStructureAccess.Mode mode, int size, String pathPrefix, bb.util.Benchmark benchmark, String result) throws Exception
Exception
protected static void outputFull(String className, N08_Part2_DataStructureAccess.Mode mode, int size, String pathPrefix, bb.util.Benchmark benchmark, String result) throws Exception
Exception
protected static int[] makeGeometricSeries(int start, int end, int n) throws IllegalArgumentException
[start, start * r, start * r^2, ..., start * r^(n-1)]
.
In other words, generates n values, the first of which is start, and the last of which is end,
which have the property that the ratio of sucessive elements is a constant r.
This last property causes a logarithmic plot of the values to have uniform point density.
The result that is actually returned is an int rounded version of that double-valued sequence that is guaranteed to have no duplicate elements. Thus, the size of the result may be less than n (but will never exceed it) and the ratio of successive elements may not exactly equal a constant r (because of the rounding).
start
- the first element in the result, guaranteedend
- the last element in the result, guaranteedn
- number of elements that would like the result to contain; the actual size of the result may be less than this
IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |