Storing a large list in isolated storage on WP7

I store a list with about 3,000 objects in Isolatedstorage using Xml serialize. It will take too much time to deserialize it, and I was wondering if you have any recommendations for speeding it up.

Time is transferred to deserialize up to 500 objects, but permanently cancels 3000 deserialization. Will it take more time only on the emulator and will be faster on the phone?

I did a whole bunch of searches, and in some article it was said to use a binary stream, but I can not find it. I store in binary or xml does not matter, I just want to save the list.

I do not want to watch asynchronous loading yet ...

+4
source share
3 answers

Check out the binary serializer that is part of sharpSerializer: http://www.sharpserializer.com/en/index.html

It is very easy and works quite well.

Here's a blog that talks about using it in WP7: http://www.eugenedotnet.com/2010/12/windows-phone-7-serialization-sharpserializer/

I use it like (consider this psuedocode and using the functions listed in eugenedotnet)

in App.xaml.cs:

Application_Dectivated() { IsolatedStorageFileStream stream = store.OpenFile(fileName, FileMode.OpenOrCreate); Serialize(stream,(obj)MyHugeList<myObject>); } Application_Activated() { IsolatedStorageFileStream stream = store.OpenFile(fileName, FileMode.Open); Deserialize(stream,(obj)MyHugeList<myObject>); } 
+3
source

Firstly, some good info here already, so +1 there.

I would recommend reviewing these articles, giving you a good perspective on the performance you can expect using a variety of box serialization methods.

Windows Phone 7 Serialization: Comparison | Eugenedotnet blog

WP7 serialization comparison

You can also consider using multiple files if you don’t need to download and write everything all in one place.

I would reiterate Jeff's recommendation that it would be a really good idea to get some significant work, which you will find after it, into the background thread so as not to impair user interaction.

This is pretty straight forward. Here's a walkthrough that I often recommend, and people find it concise and helpful.

PhαΊ‘m Tiểu Giao - Themes in WP7

And also this, recently Sean Wildermouth, who also looks pretty good.

Sean Wildermouth - WP7 Architect - Part 9 of 10: Threading

+4
source

For this many elements, you need to create an optimized serialization history. I see that many people use simple CSV and text formats for this.

Embedded serializers simply won't be fast enough.

You really should consider all this in the background thread for many reasons, although yes, you indicated that you did not want to do this.

+3
source

Source: https://habr.com/ru/post/1335885/


All Articles