Monday, April 12, 2010

WP7 IsolatedStorage Speed

I was wondering if it makes any sense fully implementing SQLite on IsolatedStorage as the "quality" of the db support will depend a lot on the speed of of the storage. I read on some posts that the speed of IsolatedStorage was a problem, but I've wanted to compare it with the speed of the Filestream. The problem is that you cannot compare the two directly so I had the idea to compare both of them with another "item" that is available on both systems. I've chosen a MemoryStream test as a constant. I am not making the same test between MemoryStream and IsolatedStorage or between MemoryStream and FileStream as I am not interested on how much faster is MemoryStream (that's why on the real device FileStream seems faster then MemoryStream but it's not true as it is not the same amount of data). I run the test for 10 times and then make an average (to have a more precise result)

























Dividing IsolatedStorage/MemoryStreamSpeed=8.5991/1.2251=7.019 and FileStream/MemoryStream= 0.7/12.7=0.05511. To get an idea about the speed differences we devide the two results and we get 127.3634 which means that the IsolatedStorage is 127 times slower than FileStream. Of course this is not an exact result, but should reflect the speed difference. I might have some "glitches" in the tests but I cannot figure them out. If this result is at least near to the real one it doesn't make any sense to implement db engine on IsolatedStorage.

Another thing that I've noticed is that the x86 implementation of WP7 Emulator is much faster then the ARM emulation of 6.5 Emulator (at least MemoryStream implementation).

You can download the projects here

9 comments:

  1. We should really force MS to make IsolatedStorage faster. Huge set of triple checks everywhere in native code of IsolatedStorage implementation just making performance too slow. Especially on write ops. Read operations near the same performance. But _each_ write operation takes a lot of time. And writing 10Mb in one operation ~1000x faster then writing same by 4Kb blocks sequentially.

    ReplyDelete
  2. We cannot force anybody to do anything. Let's hope they will read the requests and do what they have to do.

    ReplyDelete
  3. Thanks for these articles Dan, I'm an embedded developer starting porting projects to WP7 and I'm also very concerned by these issues.

    Keep up posting articles !

    ReplyDelete
  4. Did any of you actually test this before commenting?
    The download doesn't compile. Too many build errors.

    ReplyDelete
  5. I've tried it and works. What errors do you have?

    ReplyDelete
  6. This comment has been removed by a blog administrator.

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. Thanks to update your past. I search blog exactly appear to your blog. Yes I agree this is very powful content. Bye Regards Web To Print

    ReplyDelete
  9. Excellent notes very approach to viewers Thanks to update By Web Design Company In Chennai

    ReplyDelete