Package test
Class TestTypedSpeed
java.lang.Object
test.TestTypedSpeed
- All Implemented Interfaces:
XMLStreamConstants
Simple typed information access stress test, useful for profiling, as well
as for
quickly checking high-level performance effects of changes (albeit
not very accurately, obviously -- need longer running composite
tests for such verifications).
Type of data is auto-detected, and is assumed to be homogenous. Basically, data is either within attributes, or as element content, but not both. In either case structure should be shallow, with the root and only immediate leaf-level elements containing attribute or element data. Type of this data is auto-detected from the first instance; data must be in canonical format to be properly recognized (non-first values can be non-canonical).
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
Let's keep per-run times below 300 milliseconds(package private) final ByteArrayInputStream
(package private) static final int
Let's keep per-run times above 50 milliseconds(package private) final XMLInputFactory
(package private) int
(package private) boolean
Data in attributes? If true, yes; if no, in elementsprivate int
Number of repetitions to run per test.private static final int
(package private) static final int
(package private) static final int
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) org.codehaus.stax2.XMLStreamReader2
private String
static void
(package private) static byte[]
protected int
test()
private int
test2()
protected int
testTypedBooleanAttr
(int reps) protected int
testTypedBooleanElem
(int reps) protected int
testUntypedBooleanAttr
(int reps) protected int
testUntypedBooleanElem
(int reps)
-
Field Details
-
REPS
private int REPSNumber of repetitions to run per test. Dynamically variable, based on observed runtime, to try to keep it high enough. -
TEST_PER_GC
private static final int TEST_PER_GC- See Also:
-
TYPE_BOOLEAN
static final int TYPE_BOOLEAN- See Also:
-
TYPE_INT
static final int TYPE_INT- See Also:
-
MIN_RUN_TIME
static final int MIN_RUN_TIMELet's keep per-run times above 50 milliseconds- See Also:
-
MAX_RUN_TIME
static final int MAX_RUN_TIMELet's keep per-run times below 300 milliseconds- See Also:
-
mInputFactory
-
mIn
-
mUseAttr
boolean mUseAttrData in attributes? If true, yes; if no, in elements -
mType
int mType
-
-
Constructor Details
-
TestTypedSpeed
private TestTypedSpeed(byte[] data)
-
-
Method Details
-
test
- Throws:
Exception
-
findFirstValue
- Throws:
XMLStreamException
-
test2
- Throws:
Exception
-
testUntypedBooleanAttr
- Throws:
Exception
-
testUntypedBooleanElem
- Throws:
Exception
-
testTypedBooleanAttr
- Throws:
Exception
-
testTypedBooleanElem
- Throws:
Exception
-
constructAndFindRoot
- Throws:
XMLStreamException
-
readData
- Throws:
IOException
-
main
- Throws:
Exception
-