Fastest way to load data

蹲街弑〆低调 提交于 2020-01-16 00:38:32

问题


I have over 500 pieces of data (each containing 4 strings) which I want to load in my WindowsPhone application in several pages, using a ScrollViewer + Grid to display the information in TextBlocks. I thought of doing this with XML, but it didn't seem too appealing regarding speed. Is there a faster or officially preferred way to do this?


回答1:


Although results can vary depending on the object graph being used, Binary Serialization is often a good way to go. The trade off is that it's not as versatile or easy to use, but you'll likely gain speed advantages. There's a comparison table here showing different types of serialization and deserialization.




回答2:


Load the data into a collection of a custom type and use databinding.




回答3:


You might also look into Marc Gravell's port of Google's proto buffers, which has extremely impressive performance compared to the built in serialisation.



来源:https://stackoverflow.com/questions/6627898/fastest-way-to-load-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!