Are you running XML::Xpath from a command-line program? If so, are you taking into account the interpreter startup time?
I haven't seen great performance from XML::Xpath generally. I think this is partly due to the fact that it is a pure-Perl Xpath parser, which has to browse (search) an XML tree using XML::Parser (if I read it correctly). That means parse an XPath in Perl, query nodes in C, and so on. Of course, the point here is that you can write custom XPath functions in Perl. I do all my XML processing with XML::LibXML and XML::LibXSLT. I have had good performance with large tasks, including complex XPath queries on several-thousand several-megabyte files. Performance is equal to any I've seen from any other processor. If you can give more details on how you are running these parses, we can likely determine why they are slow. You should expect good performance with XML processing under Perl. On Wed, 21 Aug 2002, Mark S Lowe wrote: > I�ve now spend the entire day playing with simple Perl examples using XML > Parsers, both in an OO manner and with flat parsers, and every indication is > that XML is just too slow in Perl. Even reading a 1k file into memory using > XML::Xpath takes an entire second before a node lookup can be done. > > Does this performance sound right? I have only the simplest needs for > reading small XML files and doing very quick node lookups into hash tables. > Should I build an architecture in the database I�m using instead of talking > to flat files containing XML? > > I�d be thankful for any of your opinions. > > Thanks, > > Mark >
