[xsd-users] Memory requirements of the C++/Tree in-memory representation

Boris Kolpackov boris at codesynthesis.com
Thu Jan 4 05:42:19 EST 2007


Hi Marco,

Marco Fischer <marco.fischer at chipvision.com> writes:

> does anyone have rough numbers about the relative size of the in-memory
> representation of an XML file comparing:
>
> - in-memory representation obtained by reading an XML file through an
> xsd generated C++/Tree mapping
>
> vs.
>
> - hand-crafted classes representing the content of the XML file
>
>
> How much overhead in memory consumption would I have to expect? Just
> roughly, like x1, x2, x10?

I think you will get pretty much the same memory consumption unless you
exploit some application-specific knowledge in hand-crafted classes
(I can't even think of any non-contrived example, maybe something like
a situation where you have two identical strings in your data model
so you will actually have one string and just reference it from two
different places).

The reason for this being that XSD does all the things that one would
normally do in hand-written code: when you have an int, you will store
it as an int in your classes (even though it is text in XML), but so
does XSD-generated code. Same goes for other types (binary data, enums,
etc.). Other than that I do not see how else the memory footprint can
be different.


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070104/663a9d9c/attachment.pgp


More information about the xsd-users mailing list