iPhone 上什么速度更快? XML pList 还是 JSON?

发布于 2024-09-14 15:38:47 字数 65 浏览 4 评论 0原文

假设 XML plist 和 JSON 都是通过 http、gzip 传输的,哪一个在 iPhone 上处理得更快?

Assuming both XML plist and JSON are delivered over http, gzipped, which one will be processed faster on an iPhone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

这样的小城市 2024-09-21 15:38:47

我和一位同事最近做了一些基本的基准测试,以测试对于我们正在编写的应用程序来说哪个更快。我们测试了 JSON 框架、NSXML 解析器以及 TreeNode我们在一本 Objective-C 书中找到了解析器。以下是我发送给我们团队中其他开发人员的说明:

The benchmark tested how each library handled getting the filename and path
of 100 assets, 100 times each (for a total count of 10,000 runs per library).
The results are below:

Method    Average(s)    Total(s)
TreeNode  0.307475      30.747493
NSXML     0.483778      48.377843
JSON      0.233179      23.317870 

A co-worker and I did some rudimentary benchmarks recently to test which was faster for an application we were writing. We tested this JSON framework, and the NSXML parser as well as a TreeNode parser we found in an Objective-C book. Here is the note I sent to the other developers on our team:

The benchmark tested how each library handled getting the filename and path
of 100 assets, 100 times each (for a total count of 10,000 runs per library).
The results are below:

Method    Average(s)    Total(s)
TreeNode  0.307475      30.747493
NSXML     0.483778      48.377843
JSON      0.233179      23.317870 
自找没趣 2024-09-21 15:38:47

这取决于传递的数据及其解析方式,但它们的速度应该相似。您应该只选择一个更容易开发解析器的解析器,然后对解析器进行微调。

It depends on the data that is delivered and the way it is parsed, but they should both be similar in speed. You should just choose the one that is easier for you to develop a parser and then fine tune the parser.

入画浅相思 2024-09-21 15:38:47

在 WwDC 的“构建服务器驱动的用户体验”会议上,一位 Apple 开发人员表示 PLIST 因其速度更快、更易于使用而受到青睐。

In the "Building a Server-Driven User Experience" session of WwDC, an Apple developer stated that PLIST was preferred for being faster and easier to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文