Well, the code is about as simple as can be... so it might be hard to simplify it.
The first thing to try is to see if it is really XML::Twig causing the difference or if it is XML::Parser: try perl -MXML::Parser -e'XML::Parser->new->parsefile("rrd.xml")' and see if parsing time is similar on the 2 machines or not. then you can try adding dummy handlers to the parse, to see what's going on.
Is there a big difference in the amount of memory on the 2 computers? A 12Mb file should translate into something like 150Mb in memory, depending on the amount of tagging in the XML.
Then, do you really need to process all of the data? if not using twig_roots would reduce the memory needed and possibly speedup the code (if you skip big chunks of the data).
If you find something that explains the difference I would be very interested in knowing about it, thanks.
In reply to Re: XML Parse performance
by mirod
in thread XML Parse performance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |