|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectN14_Extra_DataStructureIteration
public class N14_Extra_DataStructureIteration
Benchmarks the time to completely iterate thru all the elements of common data structures.
This class is distinct from executing N08_Part2_DataStructureAccess
in sequential access mode:
instead of making individual (element by element) access requests of a data structure,
it always does a complete iteration thru the data structure, usually using the data structure's Iterator.
One consequence of using the data structure's Iterator is that many classes can deliver much higher performance when tested here compared to N08_Part2_DataStructureAccess. A prime example is TreeMap: it has quite poor performance when tested under N08_Part2_DataStructureAccess, even in sequential access mode, but it does much better when tested by this class.
Another consequence is that this class is able to benchmark vastly more data structures than N08_Part2_DataStructureAccess (which is limited to array-like data structures). For instance, this class can benchmark Sets, Queues, and Dequeues.
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 |
pathPrefix_key
|
protected static String |
size_key
|
Constructor Summary | |
---|---|
N14_Extra_DataStructureIteration()
|
Method Summary | |
---|---|
protected static N14_Extra_DataStructureIteration.TaskAbstract |
getTask(String className,
int size)
|
static void |
main(String[] args)
Entry point to the functionality offered by this class. |
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 size_key
protected static final String pathPrefix_key
protected static final List<String> keysLegal
main
.
Constructor Detail |
---|
public N14_Extra_DataStructureIteration()
Method Detail |
---|
public static void main(String[] args) throws Exception
Results on 2009-05-06 on my 2.5 GHz Intel Xeon E5420 machine (server jvm) are in the
.../results/newPostArticleResults/dataStructureIteration directory.
args
- must be non-null and have exactly 6 elements;
these 6 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],
-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 N14_Extra_DataStructureIteration.TaskAbstract getTask(String className, int size) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |