Performance comparison of nHibernate and Entity Framework

After running a variety of performance tests, Gergely Orosz comes to the following conclusion:

The performance measurements only provided significant differences in two cases.

  • When it comes to storing data, Entity Framework proved to be significantly faster than NHibernate
  • When deleting data, NHibernate was much faster than Entity Framework

My conclusion however after the test was that in those scenarios when the number of the operations is not too high performance does not differentiate that much. I would choose between these two tools based on which ones provides faster, more efficient and more straightforward development with the current project.

His test code will tell the real story. I spent a lot of time with the perf guys on the EF team learning how to be sure I'm making fair comparisons.

Read the details of Gergely’s tests in his blog post: NHibernate vs Entity Framework: a performance test

#1 Simon Evans on 8.26.2009 at 7:33 AM

Hi Julie

I did a comparison of EF and NHib a few months back here:

blogs.conchango.com/.../guidance-on-cho

Let me know what you think.

I agree that other factors are more important than performance. If performance is that important to you, I think you'd look to write the most efficient ADO.NET / TDS code possible to achieve your requirements.

Leave a Comment