[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More efficient XPATH



Peter Antman wrote:
Hi again, long time no see,
I am woring with XmlBlaster again (this time I might even have success
in placing at the core of a new cool project ;-).

I have been experimentling with sort of using XmlBlaster as an in memory
XML store, and querying it with XPATH and get(). The data in the key is
fairly big, and the queries big too.

First I was a little dissapointed, having 4000 document loaded, it
actually took between 3.5 to 4 sec. per query. Far to slow to be able to
use against an interactive gui.

Then I read some of the performance tips (linked from the site) and
redid my queries to start with /xmlBlaster/key/. And guess what: WOAW. am now down to 250-300 ms per query (There is still some overhead,
making it take a second once in a while when I document is retrieved).


But basically I wanted to say this: For those who like me naively use
//your-element to place XPATH queries against XmlBlaster will have a 10
fold performance hit compared to use the undocumented xmlBlaster root
element.

This is a real difference!


In the beginning of xmlBlaster we planned to normalize the xml tree, merging same parent nodes, and having the key-oid as lowest node.

But we never implemented it.


Example:

Two messages with following meta informations:

  <key oid="Number1">
      <Airport icao="EDDI">
        <Runway id="1">
           <WindVeloc w_id="2">
           </WindVeloc>
        </Runway>
      </Airport>
   </key>

   <key oid="Number2">
      <Airport icao="EDDI">
         <Runway id="1">
           <WindVeloc w_id="1">
           </WindVeloc>
         </Runway>
      </Airport>
   </key>

XmlBlaster could than reorganize the hierarchy for performant lookup:

      <Airport icao="EDDI">
        <Runway id="1">
           <WindVeloc w_id="2" oid_reference="Number1">
           </WindVeloc>
           <WindVeloc w_id="1" oid_reference="Number2">
           </WindVeloc>
        </Runway>
      </Airport>

We assume that in most projects most messages in xmlBlaster are
of the same problem domain.



</Marcel>


//Peter




-- Marcel Ruff mailto:ruff at swand.lake.de http://www.lake.de/home/lake/swand/ http://www.xmlBlaster.org