Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
263 views
in Technique[技术] by (71.8m points)

.net - Latest Dapper VS Entity Framework 6 performance considerations

There are a few performance comparisons between Dapper (which seems to be the fastest, most popular "micro ORM tool"). Now it's September 2014 and we have Entity Framework 6 (not 5, or 4) and Dapper is still around.

We will begin developing a huge database n-tier application (database has 700 tables). And some of the queries that need to be run are quite time-sensitive.

  1. Does anyone have any updates on performance regarding EF 6.1.x? This concerns general queries made within a DbContext.
  2. I suppose I cannot use nicely formatted LINQ queries with Dapper. Do you have experience with that? Is it worth losing LINQ for the additional speed?
  3. IS Dapper still under active, constant development? GitHub tells me yes, but as with Subsonic, that can change rather quickly.
  4. Is it feasable/doable to mix Dapper and EF? Dapper when we need the speed, otherwise EF.

Thank you!

question from:https://stackoverflow.com/questions/25750154/latest-dapper-vs-entity-framework-6-performance-considerations

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. Does anyone have any updates on performance regarding EF 6.1.x? This concerns general queries made within a DbContext?

Ans: I don't have specific numbers, but I have updated the performance rig to EF6; I can't remember the outcome exactly, but: EF6 is a lot faster than EF-old, but dapper is still significantly faster in many scenarios (and about the same for the edge-cases)

  1. I suppose I cannot use nicely formatted LINQ queries with Dapper. Do you have experience with that? Is it worth losing LINQ for the additional speed?

Ans: That is subjective; for us: yes, absolutely worth it - but we care lots about speed. Parsing expression trees has impact, and generated SQL is very rarely in the same league as handcrafted SQL by a decent dev

  1. IS Dapper still under active, constant development? GitHub tells me yes, but as with Subsonic, that can change rather quickly?

Ans: Absolutely; I think I've deployed about 4 versions this month...

  1. Is it feasable/doable to mix Dapper and EF? Dapper when we need the speed, otherwise EF?

Ans: Yes, you can do that; that is how we started with dapper - we used that to replace LINQ to SQL code that was causing performance problems; over time, that had grown, and now we have very little LINQ to SQL code remaining (but still some)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...