title: Why is inserting entities in EF 4.1 so slow compared to ObjectContext?
body: <p>Basically, I insert 35000 objects within one transaction:</p>
  
  <pre><code>using(var uow = new MyContext()){
    for(int i = 1; i &lt; 35000; i++) {
       var o = new MyObject()...;
       uow.MySet.Add(o);
    }
    uow.SaveChanges();
  }
  </code></pre>
  
  <p>This takes forever!
  If I use the underlying <code>ObjectContex</code>t (by using <code>IObjectAdapter</code>), it's still slow but takes around 20s. It looks like <code>DbSet&lt;&gt;</code> is doing some linear searches, which takes square amount of time...</p>
  
  <p>Anyone else seeing this problem?</p>