com.sosnoski.xmlbench
Class BenchSAX

java.lang.Object
  |
  +--com.sosnoski.xmlbench.BenchBase
        |
        +--com.sosnoski.xmlbench.BenchSAX

public class BenchSAX
extends BenchBase

SAX parser benchmark test class. This class defines a single test for a SAX parser, parsing the document text and accumulating document characteristics.

Version:
1.2
Author:
Dennis M. Sosnoski

Inner Class Summary
protected  class BenchSAX.InnerHandler
          Inner class for handling SAX notifications.
 
Fields inherited from class com.sosnoski.xmlbench.BenchBase
ATTRCHAR_COUNT_INDEX, ATTRIBUTE_COUNT_INDEX, AVERAGE_SPACE_INDEX, BUILD_AVERAGE_INDEX, BUILD_MIN_INDEX, CONTENT_COUNT_INDEX, DELTA_MEMORY_INDEX, ELEMENT_COUNT_INDEX, FIRST_SPACE_INDEX, GARBAGE_COLLECT_DELAY, GARBAGE_UNIT_DELAY, INITIAL_MEMORY_INDEX, m_configName, m_configVariant, m_lastMemory, m_lastTime, m_printPass, m_printStream, m_printSummary, MODIFY_AVERAGE_INDEX, MODIFY_MIN_INDEX, s_spaceFullDescriptions, s_spaceShortDescriptions, s_timeFullDescriptions, s_timeShortDescriptions, SERIALIZE_AVERAGE_INDEX, SERIALIZE_MIN_INDEX, SERIALIZE_SIZE_INDEX, SPACE_RESULT_COUNT, TEXT_AVERAGE_INDEX, TEXT_MIN_INDEX, TEXTCHAR_COUNT_INDEX, TIME_RESULT_COUNT, UNSERIALIZE_AVERAGE_INDEX, UNSERIALIZE_MIN_INDEX, WALK_AVERAGE_INDEX, WALK_MIN_INDEX, WALKED_SPACE_INDEX
 
Constructor Summary
BenchSAX()
          Constructor.
 
Method Summary
 int[] runSpaceTest(int passes, int excludes, byte[][] texts)
          Main space test method.
 int[] runTimeTest(int passes, int excludes, byte[][] texts)
          Main time test method.
 
Methods inherited from class com.sosnoski.xmlbench.BenchBase
getName, initMemory, initTime, printSummary, reportSpace, reportTime, reportValue, setPrint, setShowDocument, setShowPass, setVariant, testPassSpace, testPassTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BenchSAX

public BenchSAX()
Constructor.
Parameters:
print - test results listing destination (null if not to be printed)
Method Detail

runTimeTest

public int[] runTimeTest(int passes,
                         int excludes,
                         byte[][] texts)
Main time test method. This implementation of the abstract base class method just parses the document texts repeatedly, accumulating summary information for the documents which can be compared to that obtained from the documents representation tests.
Overrides:
runTimeTest in class BenchBase
Parameters:
passes - number of passes of each test
excludes - number of initialization passes excluded from averages
texts - document texts for test
Returns:
result times array

runSpaceTest

public int[] runSpaceTest(int passes,
                          int excludes,
                          byte[][] texts)
Main space test method. This implementation of the abstract base class method just parses the documents repeatedly to check memory usage by the parser.
Overrides:
runSpaceTest in class BenchBase
Parameters:
count - number of units of test to run in this pass
excludes - number of initialization passes excluded from averages
texts - document texts for test
Returns:
result times array


Company Web Site

XML Benchmark Home