Performance implications for Dapper vs. Entity Framework 6

.net dapper entity-framework orm performance

Question

A few performance comparisons exist between Dapper and (which seems to be the fastest, most popular "micro ORM tool"). As of September 2014, Entity Framework 6 (rather than 5, or 4), and Dapper are still in use.

We'll start building a large database n-tier application (database has 700 tables). Additionally, some of the queries that must be executed have a strict deadline.

  1. Does anybody have any recent information on EF 6.1.x performance? This relates to generic DbContext-based queries.
  2. I guess using Dapper prevents me from using well structured LINQ queries. Have you dealt with it before? Is the extra speed worth sacrificing LINQ for?
  3. IS Dapper still being actively developed? Yes, according to GitHub, but like with Subsonic, it may change rather rapidly.
  4. Is it feasible or possible to combine EF with Dapper? When we need speed, dapper; otherwise, EF.

I'm grateful.

1
40
9/9/2014 4:58:16 PM

Accepted Answer

  1. Does anybody have any recent information on EF 6.1.x performance? This refers to common DbContext queries, correct?

Ans: I don't have the statistics, but I upgraded the performance rig to EF6. Although I can't recall the results precisely, EF6 is substantially quicker than EF-old in many instances (and about the same for the edge-cases)

  1. I guess using Dapper prevents me from using well structured LINQ queries. Have you dealt with it before? Is the extra speed worth sacrificing LINQ for?

Ans: Although it depends on who you ask, we believe it is worth it and prioritize speed. Expression tree parsing has an influence, and produced SQL is seldom as good as handmade SQL by a competent developer.

  1. IS Dapper still being actively developed? Yes, according to GitHub, but much as with Subsonic, it may change soon.

Ans: Yes, I've delivered four or five versions this month, I believe.

  1. Is it feasible or possible to combine EF with Dapper? If we need the speed, dapper; otherwise, EF?

Yes, you may do that. When we first began using dapper, we did so to replace SQL to LINQ code that was having performance issues. Over time, however, this code grew, and there is now very little SQL to LINQ code left (but still some)

55
1/27/2017 5:51:01 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow