Let this be my first post in my new Windows CE category. I have a feeling I will be writing more stuff about WinCE in the coming months. I wanted to jot down some notes from a couple of articles I read over at OpenNetCF for future review. Most of the high level concepts I already knew, but it’s nice to get some details once in a while.
- No performance gain in keeping the data connection open for the life of an application.
- Cache reads are two orders of magnitude faster then a database read. As the article points out, this is interesting due to the fact that the database, and cached data were both stored in RAM.
- Several of the reader comments were interesting
- The first time a SqlCE Connection is opened, the database is loaded into shared memory
- One option is to have a connection opened for the life of the application, but not to use it, this is just to keep the engine loaded. Then open/close connections in your DAL as you normally would. This was recommended by Steve Lasker, a member of the SQL CE dev team. Steve also points out that reusing a command object and changing the text code hurt more then help, as you can’t take advantage of query plans. Reusing a command object can sometimes help with the garbage collector.
- Another reader provided a example where it looks like he is doing an index scan and getting faster results then directly querying the database. It’s hard to tell without running the sample code.
- GC suspends all threads while it performs necessary actions, such as freeing and moving memory. Frequent GC’s can have an adverse affect on performance.
- Remote performance monitor, which I blogged about before, is a valuable tool. This article provides a good example of how to interpret some of the numbers.
- Don’t fear the GC, and take the time to understand what the numbers in remote performance monitor mean.
I’m also in search of a decent MVC and IoC framework for Windows CE. I’ll probably be posting more on this later.