[xsd-users] XSD uses a lot of memory

Boris Kolpackov boris at codesynthesis.com
Tue Mar 17 07:01:53 EDT 2015


Hi Maxim,

Maxim Maslennikov <maxim.maslennikov at gmail.com> writes:

> I again attached the files.

The mailing list software strips your attachments for some reason.

In any case, I got them, so let's see:

1. XSD stores string-based enums as both strings and C++ enums
   (that's the "requirement", so to speak, of XML Schema). You
   store them as C++ enums only.

2. There are 4 choice elements for which XSD has separate
   data members while you have one member (imagine they were
   all of different types).

3. XSD, in order to support things like polymorphism, stores
   elements as separately-allocated nodes (unless they are of
   C++ fundamental types) while your object model does it by-
   value.

The bottom line is this: you will always be able to produce
much more efficient and optimized object model by hand since
you can make all kinds of situation-specific assumptions that
XSD can't.

Also, another thing that you can try is XSD/e and its C++/Hybrid
mapping. I am pretty sure it will be a lot closer to your object
model since it doesn't try to be as flexible and "dynamic" as
XSD.

Boris



More information about the xsd-users mailing list