[xsd-users] Slow DOM Element Creation

Boris Kolpackov boris at codesynthesis.com
Sat Jan 13 08:10:59 EST 2018


Darien Sokolov <volokosd at gmail.com> writes:

> [...] I have seen repeated calls to this particular constructor within
> the generated code:
> 
> ::xercesc::DOMElement& s (
>         ::xsd::cxx::xml::dom::create_element (
> 
> Most of these calls are within FOR loops that visit each node of each
> nested structure that is to be saved. I am not too familiar with the
> intricacies of CodeSynthesis XSD and I do not know what information should
> be provided. The end goal here is to speed up the times of the XML file
> generation.

If you are saving a lot of small XML documents/fragments, then creating
and re-using a single DOMDocument should help. See the section on
serialization in the FAQ (there is even a question on speeding things
up):

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

Boris



More information about the xsd-users mailing list