blob: 39aecca989a55302227090d2ce929b0cd62f7a70 (plain
This example measures the performance of XML parsing in the C++/Parser
mapping. It also shows how to structure your code to achieve the maximum
performance for this operation.
The example consists of the following files:
XML Schema which describes the test vocabulary.
Test XML document.
Program to generate a test document of desired size.
Class definition that represents time.
Parser skeletons generated by the XSD compiler from test.xsd.
Driver for the example. It first parses the command line arguments
and reads the entire document into a memory buffer. It then creates
a SAX parser and pre-parses and caches the schema if validation is
enabled (Xerces-C++ only). Finally, it runs the performance
measurement loop which on each iteration parses the XML document
from the in-memory buffer.
To run the example on a test XML document simply execute:
$ ./driver test-50k.xml
The -v option can be used to turn on validation in the underlying XML
parser (only makes sense for Xerces-C++, off by default). The -i option
can be used to specify the number of parsing iterations (1000 by default).
$ ./driver -v -i 100 test-50k.xml