Comparing two different frameworks for database interaction is actually difficult. An O/RM that provides increased simplicity in database querying/persisting and extreme team working improvements from the intrinsic object-oriented programming makes EF the best choice in several scenarios. This, along with the knowledge of performance bottlenecks that occurs in such a framework, will help in avoiding dangerous issues when in the production stage, when the application load increases more than expected.
The following is a comparison of all performance results of connected ADO.NET with SQLClient data provider and EF using the same data provider. Absolute values are always useless, while relative ones give us significant information about the performance results:
SqlClient |
EF |
EF + Workaround | |
---|---|---|---|
INSERT (1000 items) |
215ms |
1716ms (+ 698 %) |
none |
UPDATE (1000 items) |
268ms |
1672ms (+ 524 %) |
914ms (+ 241 %) |
DELETE |
1ms |
7ms (+ 600 %) |
40ms (+ 3900 %) |
SELECT |
1ms... |