哪个更快的XML或INI?

时间:2022-03-16 12:40:44

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

我想知道XML是否比INI更快,反之亦然。

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.

我正在开发一个包含许多文件的网站,这个问题与我关于包含许多文件的问题有关,我决定采取另一步,我想测试ini和xml,如果加载或进程将减少我的意思是该网站将是装载机更快。据我所知,INI在PHP方面非常出色,但我无法对XML与INI进行比较。

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

任何专家或非专家都可以向我解释这两件我用XML新手的东西吗?

3 个解决方案

#1


5  

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.

但只要你甚至没有遇到问题,我会使用你熟悉的那个。如果这开始变慢(你甚至不知道它是否会发生),你仍然可以学习XML。

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

所以不要对你没有的问题下定决心。我相信你还有更多工作要做。

#2


4  

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.

由于INI文件更简单,我想解析它们会花费更少的时间。也就是说,XML可以轻松地表示更复杂的数据结构。

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


1  

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.

使用小型XML文件,实例化XML解析器可能比实际解析源文件花费更长的时间。所以答案可能取决于您的应用程序是否已将XML用于其他目的。

#1


5  

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.

但只要你甚至没有遇到问题,我会使用你熟悉的那个。如果这开始变慢(你甚至不知道它是否会发生),你仍然可以学习XML。

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

所以不要对你没有的问题下定决心。我相信你还有更多工作要做。

#2


4  

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.

由于INI文件更简单,我想解析它们会花费更少的时间。也就是说,XML可以轻松地表示更复杂的数据结构。

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


1  

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.

使用小型XML文件,实例化XML解析器可能比实际解析源文件花费更长的时间。所以答案可能取决于您的应用程序是否已将XML用于其他目的。