Hi Xalan Developers,

when using the javax.xml.xpath API there seems to be a big performance
hit compared to using the org.apache.xpath API.

When evaluating a compiled XPath expression multiple times on different
context nodes as specified in Xpath Filtering
http://www.w3.org/TR/xmldsig-core/#sec-XPath it seems to take about 30
times longer.


> e.g.:
> private XPathExpression compiledXPathExpr_;
> ...
> return ((Boolean) compiledXPathExpr_.evaluate(contextNode,
> XPathConstants.BOOLEAN)).booleanValue();


As a potential source for the performance hit we identified the Method
"private XObject eval ( Object contextItem )" in
"org.apache.xpath.jaxp.XPathExpressionImpl.eval()" .

It performs much worse compared to the following code ...

> e.g.:
> private XPath xpath_;
> ...
> XObject xobject = xpath_.execute(context_, contextNode,
>   prefixResolver_);
> boolean result = xobject.bool(); 
> return result;


We beleieve the time is lost on XPathContext creation.

Thanks in advance and best regards

Konrad Lanz


-- 
Konrad Lanz, IAIK/SIC - Graz University of Technology
Inffeldgasse 16a, 8010 Graz, Austria
Tel: +43 316 873 5547
Fax: +43 316 873 5520
http://www.iaik.tugraz.at/content/about_iaik/people/lanz_konrad/
http://jce.iaik.tugraz.at/sic/products/xml_security/

Downlaod certificate chain (including the EuroPKI root certificate):
http://ca.iaik.tugraz.at/capso/certs.jsp

begin:vcard
fn:Konrad Lanz
n:Lanz;Konrad
org:IAIK/SIC;Java Security
adr:http://jce.iaik.tugraz.at/sic/products/xml_security/;;Inffeldgasse 16a;Graz;Styria;8010;Austria
email;internet:konrad.l...@iaik.tugraz.at
title:DI, Bakk.techn., BSc Hons
tel;work:+43 316 873 5547
x-mozilla-html:FALSE
url:http://www.iaik.tugraz.at/content/about_iaik/people/lanz_konrad/
version:2.1
end:vcard

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to