开发者

Has anyone else experienced slow deserialization in MonoTouch when using the .NET XmlSerializer class?

I have a MonoTouch iOS app in whic开发者_开发技巧h I'm deserializing a large list of people from a web service. The XML is pretty simple: the root node is a list of people, each person only has 5 properties. The list is fairly large...about 1000 people.

When I run the deserialization in the the iPhone simulator, the operation only takes about one second. When I run it on my iPhone 3GS, the operation takes about 13 seconds. Of course, the sim is running x86 code, and the app is runnung ARM code. Plus, the available horsepower is less in the phone than the sim. But would it really make THAT much difference???

Has anyone else experienced slow .NET serialization with MonoTouch? Does anyone know the cause? If so, have you found any way to deal with it? Perhaps threading or maybe a different serialization library?


Yes it can take that long. On the simulator we can jit code, and build specialized deserializers. On the device the entire deserialization tree has to be interpreted. Try using binary serialization, it should be better, but your best bet would be to move your object model to sqlite.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜