[xsd-users] Performance tuning issue

Boris Kolpackov boris at codesynthesis.com
Thu Mar 22 11:03:30 EDT 2012


Hi,

wingforce <wingforce at gmail.com> writes:

> By replacing some piece of code originally implemented by xsd with several
> common xml library such as libxml2 and repidxml, we found that most of them
> beats control group in xsd-tree much great in performance test.

Note that XSD-generated parsing functions do more that just parse XML.
In particular:

1. Perform XML Schema validation (if enabled).
2. Convert from text representation to C++ types (e.g., string
   representation of a number, such as "100" to C++ int value).
3. Construct the object model.

Also note that RapidXML is not a real XML parser since it can only
parse a subset of XML. See this post[1] for more information on this
issue.

Finally, note that performance is not XSD's primary goal. Rather it
is primarily designed to be powerful, flexible, and easy to use. If
you are looking for a high-performance C++ data binding implementation,
then XSD/e[2] might be a better choice.

> We are wandering whether or not there are options in either compile
> time or runtime, or any optimization suggestions can help us resolve
> the performance issue.

Yes, there are a number of things that you can do which are discussed
in Q 2.7 and 3.4 in the C++/Tree mapping FAQ:

http://wiki.codesynthesis.com/Tree/FAQ

The 'performance' example that is mentioned in these questions is a
good example of setting up C++/Tree parsing and serialization for
maximum speed.

[1] http://www.codesynthesis.com/~boris/blog/2008/05/19/real-xml-parser/
[2] http://www.codesynthesis.com/products/xsde/

Boris



More information about the xsd-users mailing list