Re: [Fwd: [Bratislava-pm] XML::LibXML performance]

Emmanuel Rodriguez <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Petr Pajas wrote:
> Hi,
>
> Tim is right. This is also the reason why SAX2 parsing is slow in 
> Perl. As for XPath performance, provided that you do not modify the 
> document significantly during your processing, you may try calling 
>
> $doc->indexElement;
>   
I tried this one first, but it was done in the second version of the 
script, that one that had all XPath striped. With that script there was 
no improvement since XPath was used only once.
> before you start XPath queries on your document.
>
> Another potential for improving XPath performance seemed to me to be 
> in letting the user pre-compile static XPath expressions and reuse 
> them in the pre-compiled form. The API, soon to appear in the SVN, 
> looks like:
>
> my $comp_xpath = XML::LibXML::XPathExpression->new($xpath);
>   
This is great and will be highly appreciated. I hope that the the 
pre-compilation of XPath expressions will allows us to interact with 
XML::LibXML::XPathContext or provide some other way to define the 
namespaces to used in the query.

Regards,
Emmanuel Rodriguez
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.