Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is faster XML or INI?

I'm wondering if the XML is faster that INI or vise versa.

I'm developing a site that includes many files this question is connected to my problem about including many files and I decided to take another step on this I want to test ini and xml if the load or process will decrease I mean the site will be faster loader. As far as I know INI is very good on PHP including but I can't do a comparison on XML vs. INI.

Can any expert or not an expert explain me about this two things I'm new with XML?

like image 918
naviciroel Avatar asked Oct 15 '11 16:10

naviciroel


3 Answers

You need to metric that with your concrete application with the data in question. It's hard to say generally.

But as long as you don't even run into a problem, I would use the one you're familiar with. In case this starts to get slow (which you don't even know if it will ever happen), you can still learn about XML anyway.

So don't make up your mind about problems you don't have. I'm sure you've got more to do.

like image 81
hakre Avatar answered Oct 18 '22 22:10

hakre


As INI files are simpler, I imagine parsing them would take slightly less time. That said, XML can easily represent much more complex data structures.

This being true, I imagine anything where the difference in parsing speed is critical would have other problems - they are both probably going to parsed fast enough for all but the most crazy of edge cases.

like image 34
Gareth Latty Avatar answered Oct 18 '22 21:10

Gareth Latty


With small XML files, instantiating the XML parser can take longer than actually parsing the source file. So the answer may depend on whether your application is already using XML for other purposes.

like image 30
Michael Kay Avatar answered Oct 18 '22 22:10

Michael Kay