public class TestTypedSpeed
extends java.lang.Object
implements javax.xml.stream.XMLStreamConstants
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).
Modifier and Type | Field and Description |
---|---|
(package private) static int |
MAX_RUN_TIME
Let's keep per-run times below 300 milliseconds
|
(package private) java.io.ByteArrayInputStream |
mIn |
(package private) static int |
MIN_RUN_TIME
Let's keep per-run times above 50 milliseconds
|
(package private) javax.xml.stream.XMLInputFactory |
mInputFactory |
(package private) int |
mType |
(package private) boolean |
mUseAttr
Data in attributes? If true, yes; if no, in elements
|
private int |
REPS
Number of repetitions to run per test.
|
private static int |
TEST_PER_GC |
(package private) static int |
TYPE_BOOLEAN |
(package private) static int |
TYPE_INT |
Modifier | Constructor and Description |
---|---|
private |
TestTypedSpeed(byte[] data) |
Modifier and Type | Method and Description |
---|---|
(package private) org.codehaus.stax2.XMLStreamReader2 |
constructAndFindRoot() |
private java.lang.String |
findFirstValue(java.io.InputStream in) |
static void |
main(java.lang.String[] args) |
(package private) static byte[] |
readData(java.io.File file) |
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) |
private int REPS
private static final int TEST_PER_GC
static final int TYPE_BOOLEAN
static final int TYPE_INT
static final int MIN_RUN_TIME
static final int MAX_RUN_TIME
final javax.xml.stream.XMLInputFactory mInputFactory
final java.io.ByteArrayInputStream mIn
boolean mUseAttr
int mType
protected int test() throws java.lang.Exception
java.lang.Exception
private java.lang.String findFirstValue(java.io.InputStream in) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
private int test2() throws java.lang.Exception
java.lang.Exception
protected int testUntypedBooleanAttr(int reps) throws java.lang.Exception
java.lang.Exception
protected int testUntypedBooleanElem(int reps) throws java.lang.Exception
java.lang.Exception
protected int testTypedBooleanAttr(int reps) throws java.lang.Exception
java.lang.Exception
protected int testTypedBooleanElem(int reps) throws java.lang.Exception
java.lang.Exception
org.codehaus.stax2.XMLStreamReader2 constructAndFindRoot() throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
static byte[] readData(java.io.File file) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception