Entity framework vs NHibernate - Performance

entity-framework nhibernate


I am looking to implement an ORM into our system. We currently have many tables with lots of horrible data and stored procedures. I've heard using an ORM can slow the system down. Does anyone know which ORM is better on speed and performance using Queries created in the C# code and mapping to stored procedures?



The project will use existing tables that are large and contain a lot of data, it will also use existing stored procedures that carry out complex tasks in a SQL Server DB. The ORM must be able to carry out transactions and have high performance when running the existing stored procedures and querying the current tables. The project is web based and will use WCF web services with DDD. I can see that EF is a lot easier to use and has greater support but if NH the most suitable option?

8/2/2013 8:29:20 AM

Popular Answer

The Entity Framework is constantly implementing new features and everything is automated in your project. It is very easy to use Entity Framework, extend and refactor your code. Visual Studio integrates it (Code-First, Database-first, Entity-First...) like a charm. Windows Azure makes easy to deploy and change it. Moreover Visual Studio can generate all your CRUD pages in 3 clicks.

I would suggest you use EF but it depends of your project. Can you give us more details about it?

You can find lots of comparison charts on Google, for example this one explains performance and this one differences.


Can you quantify the number of users in your application?

When you use Database-First in EntityFramework it is very easy to import and use stored procedures, for NHibernate it quite simple as well. Note that if you use a lot of stored procedures and not a lot of simultaneous users the choice of a ORM between those two may not be so crucial.

Also don't forget the performance of a tool is often based on the way to use it. If you misuse the ORM (e.g. async, lazy/eager loading, base classes, ...) the performance will drastically drop.

Perhaps you can instal both of them, look at how they work and check at their roadmap (e.g. Entity framework) to check at the evolution and interest.

2/20/2018 4:02:51 PM

Related Questions


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