title: EF6/Code First: Super slow during the 1st query, but only in Debug
body: <p>I'm using EF6 rc1 with Code First strategy, without precompiled views and the problem is:
  If I compile and run the exe application it takes like 15 seconds to run the first query (that's okay, since I'm still working on the pre-generated views). But if I use Visual Studio 2013 Preview to Debug the exact same application it takes almost 2 minutes BEFORE running the first query:</p>
  
  <pre><code>Dim Context = New MyEntities()
  Dim Query = From I in Context.Itens '' &lt;--- The debug takes 2 minutes in here
  Dim Item = Query.FirstOrDefault()
  </code></pre>
  
  <p>Is there a way to remove this extra time? Am I doing something wrong here?</p>
  
  <p>Ps.: The context itself is not complicated, its just full with 200+ tables.</p>
  
  <p>Edit: Found out that the problem is that during debug time the EF appears to be generating the Views ignoring the pre-generated ones. 
  Using the source code from EF I discovered that the property:</p>
  
  <pre><code>IQueryProvider IQueryable.Provider
      {
          get
          {
              return _provider ?? (_provider = new DbQueryProvider(
                                                   GetInternalQueryWithCheck("IQueryable.Provider").InternalContext,
                                                   GetInternalQueryWithCheck("IQueryable.Provider").ObjectQueryProvider));
          }
      }
  </code></pre>
  
  <p>is where the time is being consumed. But this is strange since it only takes time in debug. Am I missing something here?</p>
  
  <p>Edit: Found more info related to the question:
  Using the Process Monitor (by Sysinternals) I found out that there its the 'desenv.exe' process that is consuming tons of time. To be more specific its consuming time with an 'Thread Exit'. It repeats the Thread Exit stack 36 times. I don't know if this info is very useful, but I saved a '.cvs' with the stack, here is his body: [...] (edit: removed the '.cvs' body, I can post it again by the comments if someone really think its going to be useful, but it was confusing and too big.)</p>
  
  <p>Edit: Installed VS2013 Ultimate and Entity Framework 6 RTM. Installed the Entity Framework Power Tools Beta 4 and used it to generate the Views. Nothing changed... If I run the exe it takes 20 seconds, if I 'Start' debugging it takes 120 seconds.</p>
  
  <p>Edit: Created a small project to simulate the error: <a href="http://sdrv.ms/16pH9Vm" rel="noreferrer">http://sdrv.ms/16pH9Vm</a>
  Just run the project inside the environment and directly through the .exe, click the button and compare the loading time.</p>