问题描述
我很好奇你的解决方案是用于iPhone的高性能XML解析,鉴于其有限的CPU功率。我已经审查了苹果提供的XML性能应用程序作为演示,似乎为数据源(300 iTunes歌曲),他们正在解析.. libxml2总是似乎成为最前沿的赢家。
I'm curious what your solution is for high performance XML parsing on the iPhone is, given its limited amount of CPU power. I have reviewed the XML Performance App that Apple provides as a demonstration, and it seems that for the data feed (300 iTunes songs) that they're parsing.. libxml2 always seem to come as the forefront winner.
您在处理数据的经验< 100Kb,你最喜欢什么最佳性能?我目前使用TouchXML + libxml2,并查看是否可以优化解析速度。
With your experience in dealing with data that's < 100Kb, what do you prefer for optimal performance? I'm currently using TouchXML + libxml2 and looking to see if it's possible to optimize on the parsing speeds as is.
感谢您的反馈!
推荐答案
我一般发现更大的数据块(像你引用的苹果示例)libxml2往往更快。对于较小的数据块,差异可以忽略不计。我喜欢NSXMLParser的一个优点是它是基于Objective-C的XML解析器的实现,其中libxml2是基于C的。
I've generally found for larger chunks of data (like the apple example you reference) libxml2 tends to be faster. For smaller chunks of data, the difference is negligible. One advantage i like about NSXMLParser is that it is an Objective-C based implementation of an XML Parser where libxml2 is C based.
这篇关于使用libxml2或NSXMLParser在iPhone上更好的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!