commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: [digester] Re: Digester Quesion
Date Thu, 10 Feb 2005 00:08:36 GMT
On Wed, 2005-02-09 at 18:26 -0500, Luke Shannon wrote:
> Hi All;
> 
> Someone just looked at my code that uses Digester and commented that they
> thought it would be slow (compared to SAX or DOM directly) because it would
> need to use "reflection a lot".
> 
> I am not sure what this means. But since I am using  digester a lot I would
> like to know if it is does use a lot of resources (compared to other XML
> parsing API) and if there is anything I can do about it. If someone could
> point me to some reference articles that would be great too, I may need to
> present some evidence to support my choice of Digester.

Yes, Digester does use reflection to invoke methods on your classes, and
that does carry a small performance penalty. Hand-coded SAX-based code
will be faster. Anything using DOM will be slower, as DOM has its own
penalties that far outweigh those of Digester.

But if you really cared about performance, you wouldn't be writing your
application in java anyway, right? Nor using XML which is much slower
than binary-encoded data formats. 

In most cases, the performance difference between Digester and
hand-coded SAX handling just isn't significant. Ok, maybe if you're
repeatedly processing massive volumes of xml in some kind of
performance-critical manner (eg a newspaper print-preparation system)
you should look at some alternatives. But even then you need to take
into account the costs of development and maintenance (lower when using
a decent library rather than hand-coding) vs the costs incurred by the
slightly lower performance.

You can find a list of alternatives to digester here:
  http://wiki.apache.org/jakarta-commons/Digester/WhyUseDigester

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message