本文介绍了性能的nspropertylistserialization对nsjsonserialization的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑将从我的Web服务端点的数据序列化为JSON转换为二进制属性列表。我在可可上unserializing。有谁使用 NSPropertyListSerialization NSJSONSerialization 注意到解析时间的差异?我很好奇,因为我之前读过,有一个明显的区别 - 见(在敞篷部分)以Hipmunk为例。

I'm considering making a switch from serializing data from my web service endpoint as JSON to a binary property list. I'm unserializing on Cocoa. Has anyone who has used both NSPropertyListSerialization and NSJSONSerialization noticed a difference in parsing times? I'm curious as I've read before that there's a noticeable difference—see this blog post (in the Under the Hood section) for an example by Hipmunk.

如果NSJSONSerialization和NSJSONSerialization之间有明显的区别,外部库,例如或。

Also interesting to me if there's a noticeable difference between NSJSONSerialization and external libraries like JSONKit or TouchJSON.

推荐答案

我可以说 NSJSONSerialization 比JSONKit快,我使用它为Core Graphics项目和代码平均26ms之前是现在16ms,只有JSON反序列化的变化。

I can say that NSJSONSerialization is faster than JSONKit, I used it for a Core Graphics project and code which took on average 26ms before is now 16ms, with only changes in the JSON deserialization.

不确定 NSPropertyListSerialization ,但 JSONKit的页面声称它比二进制.plist快,这使我相信 NSJSONSerialization 类是最快的。如果我错了,请更正我。

Not sure on NSPropertyListSerialization, but the GitHub page of JSONKit claims it's faster than binary .plist, which leads me to believe that NSJSONSerialization class is the fastest of them all. Correct me if I'm wrong.

这篇关于性能的nspropertylistserialization对nsjsonserialization的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 00:57