cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Øie <>
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 - 0m14.686s
(first hit)
time wget - 0m0.030s
(second hit)

time wget - 0m5.882s (first
time wget - 0m0.012s (second

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. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message