cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Øie <k...@gan.no>
Subject RE: performance tuning... (match="id(xxx)" versus match="//*[@id=xxx]")
Date Fri, 24 Aug 2001 13:11:25 GMT
wget timings of match="id(xxx)" versus match="//*[@id=xxx]":
------------------------------------------------------------

time wget http://saturn.gan.no:8888/mup/xpath.xsp?xpath=KAP1 - 0m14.686s
(first hit)
time wget http://saturn.gan.no:8888/mup/xpath.xsp?xpath=KAP1 - 0m0.030s
(second hit)

time wget http://saturn.gan.no:8888/mup/id.xsp?id=KAP1 - 0m5.882s (first
hit)
time wget http://saturn.gan.no:8888/mup/id.xsp?id=KAP1 - 0m0.012s (second
hit)


these stats show that Joerg's tips about using a id() lookup instead of a
xpath lookup upon id attributes was correct, id() performed 2,5 times better
on first hit, and also on cached result. I will now start to edit all my XML
files and use id() lookup instead! thanks!!!

mvh Karl Xie



> Can you give us a feed back? ;)
>
> Thanks,
>
> --Arnaud



> If you have a DTD for your XML and your @id is really unique in the whole
> XML, you can use the id()-function of XPATH. Instead of "//*[@id='1222']"
> use "id('1222')". This takes much less time than your statement (around
> factor 10; of course dependent on the size of the XML, my XML was
> 150 KB ->
> maybe better factor for you).
>
> Joerg


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message