Which is faster XML or INI?

一曲冷凌霜 提交于 2019-12-10 13:45:49

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/7779060/which-is-faster-xml-or-ini

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!