summaryrefslogtreecommitdiff
path: root/xsd-examples/cxx/tree/performance
diff options
context:
space:
mode:
Diffstat (limited to 'xsd-examples/cxx/tree/performance')
-rw-r--r--xsd-examples/cxx/tree/performance/README41
-rw-r--r--xsd-examples/cxx/tree/performance/buildfile4
2 files changed, 33 insertions, 12 deletions
diff --git a/xsd-examples/cxx/tree/performance/README b/xsd-examples/cxx/tree/performance/README
index 0206387..65e3edd 100644
--- a/xsd-examples/cxx/tree/performance/README
+++ b/xsd-examples/cxx/tree/performance/README
@@ -13,6 +13,16 @@ test-50k.xml
gen.cxx
Program to generate a test document of desired size.
+ To compile and link this program we can use the following commands
+ (replace 'c++' with your C++ compiler name):
+
+ c++ -c gen.cxx
+ c++ -o gen gen.o
+
+ To generate the test document execute, for example:
+
+ ./gen 633 test-100k.xml
+
time.hxx
time.cxx
Class definition that represents time.
@@ -23,8 +33,12 @@ test.cxx
C++ types that represent the given vocabulary, a set of parsing
functions that convert XML documents to a tree-like in-memory object
model, and a set of serialization functions that convert the object
- model back to XML. These are generated by the XSD compiler from
- test.xsd.
+ model back to XML.
+
+ These files are generated by the XSD compiler from test.xsd using the
+ following command line:
+
+ xsd cxx-tree --generate-serialization test.xsd
parsing.cxx
Parsing performance test. It first reads the entire document into
@@ -46,17 +60,26 @@ driver.cxx
It then initializes the Xerces-C++ runtime and calls the parsing
and serialization tests described above.
-To run the example on a test XML document simply execute:
+To compile and link the example manually from the command line we can use
+the following commands (replace 'c++' with your C++ compiler name):
-$ ./driver test-50k.xml
+c++ -DXSD_CXX11 -c test.cxx
+c++ -DXSD_CXX11 -c time.cxx
+c++ -DXSD_CXX11 -c parsing.cxx
+c++ -DXSD_CXX11 -c serialization.cxx
+c++ -DXSD_CXX11 -c driver.cxx
+c++ -o driver driver.o test.o time.o parsing.o serialization.o -lxerces-c
+
+Note that we need to define the XSD_CXX11 preprocessor macro since the
+source code includes libxsd headers directly.
+
+To run the example on a test XML document execute:
+
+./driver test-50k.xml
The -v option can be used to turn on validation in the underlying XML
parser (off by default). The -i option can be used to specify the
number of parsing and serialization iterations (1000 by default). For
example:
-$ ./driver -v -i 100 test-50k.xml
-
-To generate the test document execute, for example:
-
-$ ./gen 633 test-100k.xml
+./driver -v -i 100 test-50k.xml
diff --git a/xsd-examples/cxx/tree/performance/buildfile b/xsd-examples/cxx/tree/performance/buildfile
index e9faeef..7b28308 100644
--- a/xsd-examples/cxx/tree/performance/buildfile
+++ b/xsd-examples/cxx/tree/performance/buildfile
@@ -14,9 +14,7 @@ exe{driver}: xml{test-50k}: test.input = true
<{hxx ixx cxx}{test}>: xsd{test} $xsd
{{
- diag xsd ($<[0]) # @@ TMP
-
- $xsd cxx-tree --std c++11 \
+ $xsd cxx-tree \
--generate-inline \
--generate-serialization \
--output-dir $out_base \