SAXBench is a benchmark program for event-driven XML parser. It's derived from SAXCount/SAX2Count, the sample program of Xerces-J.
SAXBench supports API such as SAX1, SAX2, JAXP1.1, TinyXML, Lark. It's easy to write driver to support other SAX-like API.
JDK 1.1 or higher. Perl for runSAXBench.pl.
java sax.SAXBench [options] filenames...
You can specify one of the following drivers with -d option:
> java sax.SAXBench -d sax.JAXPDriver -w 2 -r 5 SAXBench.xml warmup: 1356 ms warmup: 174 ms parse: 49 ms parse: 72 ms parse: 57 ms parse: 195 ms parse: 74 ms avg. = 89 ms mem. = 174304 bytes
mem. indicates approximate value of static memory usage of the parser and its library.
For convenience, runSAXBench.pl perl script is available.
You need to change following variables in this script.
runSAXBench.pl [-name parser] [-J "java options"] [SAXBench options] filenames...
parser is one of the following names.
Copyright (c) 2001 by Ryosuke Nanba and The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.