title: Improving performance Linq to Sql Compact Edition
body: <p>I'm writing a WPF client app, using Linq to Sql with Sql Compact edition.
  The db is relatively small (3MB) and read-only.</p>
  
  <p>Bottom line is that The performance are not as good as I hoped them to be, and I'm looking for tips and practical ways to increase that.</p>
  
  <p>More facts:
  The schema contains around a dozen of entities with extensive relations between them.</p>
  
  <p>Profiling the app found out that the query is being run quite fast but building the c# Entities is the the process that take the most time (could be up to 8 seconds).
  Mostly I believe because we have used LoadWith, and the DataContext got no choice but to build the objects graph in memory.</p>
  
  <p>I can provide additional information, if needed.</p>
  
  <p>EDIT:</p>
  
  <ol>
  <li>As I mentioned the db is read-only so DataContext is not tracking changes.</li>
  <li>We are making use of static queries on reoccurring queries. The problem is when the application is initializing and we prefetch many objects to memory to be served as cache.</li>
  </ol>
  
  <p>Thanks for your help.</p>
  
  <p>Ariel</p>