Objective-C的JSON解析器比较(JSON框架,YAJL,TouchJSON等) [英] Comparison of JSON Parser for Objective-C (JSON Framework, YAJL, TouchJSON, etc)

查看:127
本文介绍了Objective-C的JSON解析器比较(JSON框架,YAJL,TouchJSON等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,Objective-C有三个JSON解析器, JSON Framework YAJL 触摸JSON 。然后,这三个将有自己的特点。



例如:

YAJL可以用作SAX样式解析器。

JSON Framework有相对较长的历史,并且被广泛使用。

Touch JSON解析NSData而不是NSString。

As far as I know, there are three JSON Parsers for Objective-C, JSON Framework, YAJL, and Touch JSON. Then, These three would have their own characteristics.

For example:
YAJL can be used as a SAX style parser.
JSON Framework has relatively long history and is widely used.
Touch JSON parses NSData instead of NSString.

此外,目前为止在我测试时,性能比较的结果如下:

[fast] YAJL> JSON Framework> Touch JSON [slow]。

In addition, as far as I tested, the result of performance comparison is as follows:
[fast] YAJL > JSON Framework > Touch JSON [slow].

如果你知道这些JSON解析器的优缺点,你能告诉我吗?

最后,如果你知道任何其他JSON解析器,请告诉我。

If you know pros and cons of these JSON parsers, could you tell me?
Lastly, if you know any other JSON Parser, please tell me.

推荐答案

如果您正在寻找速度,请查看 JSONKit 。它(通常)比已经提到的JSON库快得多,通常快一个数量级。由于它是最近实例化的对象缓存,它(通常也会)使用更少的内存。

If you're looking for speed, take a look at JSONKit. It is (usually) much faster than the already mentioned JSON libraries, often an order of magnitude faster. And because of it's "recently instantiated object cache", it will (again, usually) use less memory as well.

这篇关于Objective-C的JSON解析器比较(JSON框架,YAJL,TouchJSON等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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