什么在iPhone上更快? XML pList还是JSON? [英] what's faster on iPhone? XML pList or JSON?

查看:99
本文介绍了什么在iPhone上更快? XML pList还是JSON?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设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?

推荐答案

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

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 

这篇关于什么在iPhone上更快? XML pList还是JSON?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆