Hello, On 2/14/03 8:07 PM, "Johannes Gutleber" <[EMAIL PROTECTED]> wrote:
> On 2/14/03 7:35 PM, "Tinny Ng" <[EMAIL PROTECTED]> wrote: >> Have you tried out our new DOM in the latest distribution? We have >> redesigned our DOM implementation in Xerces-C++ 2.0 for faster performance >> and less memory footprint. >> http://xml.apache.org/xerces-c/program-dom.html#Objectives has more details. I tried Xerces 2.2 on both, Linux (RedHat kernel V 2.4.9-31.1, i386) and on MacOS X (10.2.4). An example program that creates a DOM document and populates it with 1.000.000 nodes (element name="abcde") in 3 layers (100x100x100) and sets one single attribute in each node (name="abcde", value="abcde") gives the following results for the peak size of the run-time image on Linux: Xerces V 1.6: 289 MB Xerces V 2.2: 251 MB Not setting the attribute gives for Xerces V 2.2: 89 MB. Profiling the program reveals that indeed only 12% of memory allocations are due to DOMString creation. 87% go in page allocations for classes (sidebar: can anybody recommend a C++ class instantiation tracker that gives nice summary information about the object sizes created? We're using Insure++, mpatrol and the Apple developer tools on Mac, but none of the tools are really verbose enough). Since our application uses attributes on each node, the program suffers from the extensive memory usage that the creation of a DOMAttr requires. I understand that this is because a DOMAttr is modelled after the DOMNode, thus keeping the internal model homogeneous. I do wonder, however, if there are any plans of making this concept more lightweight in the future, since attributes do not necessarily need all the functionality that DOMNodes in a document tree require (personal opinion and may be not applicable to all use cases). Take care. Johannes CERN European Organization for Nuclear Research 1211 Geneva 23, Switzerland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]