On Tue, Jan 23, 2001 at 10:06:13AM +0000, Matt Sergeant wrote:

> The only gain might be in a large DOM tree where there may be
> thousands of objects. But then you're really better off using an
> array based class instead (as I found out).

This is getting a bit off-topic, but I'm empirically found that the
DOM is not necessarily the best object model to use in a mod_perl
environment.  XML::DOM in particular has such a high overhead in terms
of memory (and memory leaks) and performance, that it is sometimes
inappropriate for a context that requires a small footprint, and
generally fast throughput (like mod_perl).

For example, in version 1 of the Avacet perl libraries, we were using
XML::DOM for both our XML-RPC mechanism and as the underlying data
structure for object manipulation.  In version 2, however, we created
an architecture that automatically converts between the language
agnostic XML and native blessed objects using a custom engine built on
the PerlSAX parser.  This reduced our memory footprint dramatically,
stopped up the memory leaks, and increased performance significantly.
Moreover, the object model now exposed is based on native perl objects
with an API geared toward property manipulation (i.e., get_foo,
set_foo) which is easier to program directly to than the DOM.

You can see this in action with the modules available in the
Avacet::Core::Rpc::Xml namespace at www.avacet.com.  

Best regards,

-DeWitt

Reply via email to