[xsd-users] Re: parsing/serialization performance
Brian Kuschak
bkuschak at yahoo.com
Fri Feb 6 17:33:52 EST 2009
Hi Boris,
Thanks for the tip! After implementing something similar to the performance/parsing.cxx file, the operation is much, much faster on the embedded target (~100msec). It also allowed me to easily pass the XML message in a memory buffer instead of using a temporary file.
Best regards,
Brian
________________________________
From: Boris Kolpackov <boris at codesynthesis.com>
To: Brian Kuschak <bkuschak at yahoo.com>
Cc: xsd-users at codesynthesis.com
Sent: Thursday, February 5, 2009 9:28:57 AM
Subject: parsing/serialization performance
Hi Brian,
I've CC'ed the xsd-users mailing list in case someone else ran or
will run into a similar problem.
Brian Kuschak <bkuschak at yahoo.com> writes:
> I have run into a major issue though, and that is performance on the
> embedded target (arm7). On the PC, things complete in ~ 50 msec.
> However, on the embedded target, it takes a very long 4.6 seconds
> to parse a small XML message and generate a short response.
> Unfortunately this is an order of magnitude too slow for me. I've
> determined that the great bulk of this time is taken by the
> construction of the top level object for parsing:
> auto_ptr<top> xml(top_(fname));
> and the construction of the top-level serializer object:
> top_(fout, xml, map);
Parsing and serialization functions do the following steps for each
document being parsed/serialized which can be moved out and done only
once during the application startup:
1. Initialization/termination of Xerces-C++
2. Construction of parser/serializer objects
3. For parsing, if XML Schema validation is enabled, loading of
the schema(s).
The 'performance' example in the examples/cxx/tree/ directory
shows how to do all this. For more information on how to parse
from std::istream and serialize to std::ostream see the C++/Tree
Mapping FAQ, Q2.4 and Q3.2:
http://wiki.codesynthesis.com/Tree/FAQ
Boris
More information about the xsd-users
mailing list