I'm pretty sure Entity Framework doesn't even use prepared commands when doing inserts/updates. E.g. It's not doing a DbCommand.Prepare() the first time through and then only sending parameter values when doing the actual inserts/updates. I found this surprising. Does anyone know if there is a reason for this? I'm pretty sure if they at least used prepared commands that insert/update performance would be significantly improved even without batching. I'm wondering if I should make a separate feature request for this.
Also, I would like a method that allows you to clear the DbContext so that you can minimize the number of objects that are being tracked. NHibernate has a way of doing this. As far as I know, the only way to do this with Entity Framework is to create a new DbContext and dispose of the old one. I have found that doing this, significantly slows things down.
Regarding what someone else was saying about how batch updates aren't something that EF should focus on. I agree with what Luke was saying about how it's still useful in terms of code simplicity and maintainability even if it is slower. It just depends how much slower. The good thing about EF is that it's DBMS independent. Let's say you want to develop an import application that supports any DBMS. EF is a great way to do that. It would be unfortunate if your main app was DBMS independent due to using EF and then you had to write lower-level code for an import app that isn't DBMS independent.
Also, I would like a method that allows you to clear the DbContext so that you can minimize the number of objects that are being tracked. NHibernate has a way of doing this. As far as I know, the only way to do this with Entity Framework is to create a new DbContext and dispose of the old one. I have found that doing this, significantly slows things down.
Regarding what someone else was saying about how batch updates aren't something that EF should focus on. I agree with what Luke was saying about how it's still useful in terms of code simplicity and maintainability even if it is slower. It just depends how much slower. The good thing about EF is that it's DBMS independent. Let's say you want to develop an import application that supports any DBMS. EF is a great way to do that. It would be unfortunate if your main app was DBMS independent due to using EF and then you had to write lower-level code for an import app that isn't DBMS independent.