php - How can I benchmark the XML parser of my choice?


I will handle a huge XML file and I will go with XMLReader. Below are three ways to go with, but I need to know which one is the fastest. How can I know this? The planet.xml file is located at in case hat you may need it. Thank you!




You might want to consider the PHP profiling extension:

You can examine the results with pprofp:




I haven't worked with XML much in PHP, but if you're dealing with a really large file, a streaming parser is the way to go. Reading the whole thing into memory and building a DOM tree is pretty expensive (and may even fail, if the document's too big to hold in memory).

People are also looking for solutions to the problem: javascript - How do I put id number from select tag to a php link?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.