Dramatic performance gains with Libxml

Discussion in 'XML' started by Ramon F Herrera, Sep 16, 2012.

  1. 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
     
    Ramon F Herrera, Sep 16, 2012
    #1
    1. Advertising

  2. On Sep 16, 12:53 pm, Ramon F Herrera <> wrote:
    > 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



    On Sep 14, 12:04 am, Joe Kesselman <>
    wrote:

    > 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
     
    Ramon F Herrera, Sep 16, 2012
    #2
    1. Advertising

  3. On 9/16/2012 2:24 PM, Ramon F Herrera wrote:
    > 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."
     
    Joe Kesselman, Sep 20, 2012
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Gregory
    Replies:
    1
    Views:
    533
  2. Olav
    Replies:
    3
    Views:
    4,372
  3. StinkyDuck

    Detect When a Control Gains Focus

    StinkyDuck, Nov 15, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    333
    Scott Roberts
    Nov 15, 2007
  4. David A. Black
    Replies:
    6
    Views:
    131
    James Britt
    Aug 4, 2004
  5. Curt Hibbs
    Replies:
    3
    Views:
    133
    Tom Copeland
    Oct 26, 2005
Loading...

Share This Page