Performance issues?

Apr 19, 2011 at 8:58 AM

I'm building a WP7 application in which I load around 1000 entities from the web, and was considering this db-solution as a performance improvement and load the entitities from "disk" instead of fetching them from the server every launch. But after having implemented the solution and evaluated the performance I see a startup time increase around 200% and a synchronization time increase around 300-400% (yep 3-4 times longer than earlier).

I'm guessing that I'm using the project poorly (opening the database quite often instead of keeping a singleton instance)... Any guidance on how to use this in a something more than a "one" table solution. Especially with relations between tables and such.

Coordinator
Apr 20, 2011 at 12:51 AM

Here are a few sample rules that should solve your performance troubles:

  1. Use single instance of database for entire application. If you have just one view model, you can put DB into that view model. Otherwise, you can house one instance in application object. Just create a property in one class or the other to return an instance of the database
  2. Open database with lazy loading option enabled. This option is available on of the overloads of OpenDatabase()

Thanks.

Sergey.