in reply to my xml xpath is too slow.
The first suggestion that comes to my mind is to ditch XML::XPath and replace it with XML::LibXML. That will speedup your code, and you will be using a module that is actually maintained.
Then of course the //pair[@id = '.$n.'] is a big red flag. Especially as you seem to be doing this twice for each $n (it's hard to tell as your code is not indented). Either try to have the complete path above pair, or do the search on //pair only once, cache the results in a hash id => node and use this in the rest of your code. Does this make sense?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: my xml xpath is too slow.
by Anonymous Monk on Aug 26, 2009 at 09:38 UTC | |
by mirod (Canon) on Aug 26, 2009 at 09:47 UTC |