Dramatic performance gains with Libxml

R

Ramon F Herrera

Hello all:

I am glad to report that after I replaced my previous XPath code with
libxml2, my application is running faster. In fact, the qualifier
"Dramatic performance gains" is an understatement. This result is from
one of my many test cases:

Processing with with Xerces + XQilla: 12 minutes
Processing time with libxml: 3 seconds

Additionally, coding under libxml is much easier and straightforward
PLUS the support is not even in the same league.

Congratulations and thanks to all involved!

Sincerely,

-Ramon
 
R

Ramon F Herrera

Hello all:

I am glad to report that after I replaced my previous XPath code with
libxml2, my application is running faster. In fact, the qualifier
"Dramatic performance gains" is an understatement. This result is from
one of my many test cases:

Processing time with Xerces + XQilla: 12 minutes
Processing time with libxml:           3 seconds

Additionally, coding under libxml is much easier and straightforward
PLUS the support is not even in the same league.

Congratulations and thanks to all involved!

Sincerely,

-Ramon


The Xerces implementation is single-pass, I believe;
if you want to run more than one path the advantage goes away
quickly because you have to reparse the input document.

That was exactly the nature of my problem. The Xerces+Xqilla XPath
forces you to prepare the XPath query as a dependency to the XML file
opening and parsing.

My app, which it is safe to say is typical, processes:

- 1 XML file
- 300 XPath queries

You cannot "factor out" the XML parsing, and my documented ended up
being opened and parsed 300 times.

With libxml, I open and parse the XML file ONCE (keep the "doc"
reference as a constant) and then get into a loop, processing the
xpath queries.

-Ramon
 
J

Joe Kesselman

With libxml, I open and parse the XML file ONCE (keep the "doc"
reference as a constant) and then get into a loop, processing the
xpath queries.

The same would apply with Xalan, or any other implementation of the TrAX
APIs, running against a preloaded document.


--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html

{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top