title: Performance problems using entity framework 5 with large resultset
body: <p>I'm using Entity Framework 5, and I'm executing a query that returns a relatively large resultset, around 30,000 rows. The query itself executes very fast, taking only around 700ms.</p>
  
  <p>After building the linq query I call <code>query.Load();</code>, and then return <code>DataContext.Set&lt;MyType&gt;.Local</code> as an <code>ObservableCollection</code> to the caller. The results are displayed in an editable grid.</p>
  
  <p>The problem is with the <code>query.Load();</code> call - it's taking around 60 seconds, which is way too long. I'm <em>guessing</em> that this is where EF transforms the results into .NET objects? I've tried profiling, but it won't go any deeper than <code>IQueryable.Load</code> :/</p>
  
  <p>Any ideas how can I improve performance?</p>
  
  <p>BTW, I tried upgrading to EF6 to see if that helped any, but it actually got worse, wih <code>query.Load();</code> typically taking 100 seconds!</p>