问题
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