On Mon, Aug 08, 2005 at 01:59:32PM +0200, Jenssen, Bjørn Egil wrote:
> Hi
> 
> Im using xmlXPathEvalExpression (in libxml) to select individual elements in 
> an XML file, the problem is that it seems to be relatively slow, at least on 
> the files im using (10mb+ in size). By slow i mean around 0.25sec for each 
> search, which is way too slow when I have to do thousands of these searches 
> on each file. Is there any way to optimize these searches for big files?

  At libxml2 level, no except except you should precompile the XPath and
use xmlXPathCompiledEval.
  You nee to optimize your expressions, use ids for example. There is no
magic recipe, it all depends on your data and what you are searching for,
but 10mb+ probably means around 100MB in memory, and if you didn't optimized
your expression searches, crawling though this may take time, yes, no
way around.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to