Performance Analysis of .NET Based Object–Relational Mapping Frameworks
Object-relational mapping is a technology that connects relationships with object-oriented entities, which aims to eliminate duplicate layers together with costs of maintenance and any errors arising from their existence. A lot of tools and technologies were designed in order to support and implement idea of object-relational mapping. In this paper we present the performance comparison of two most common object-relational mapping interfaces for .NET framework: Entity Framework and NHibernate. In the .NET developers community, there is a lot of discussion today about the similarities and differences of the both technologies. To address this issue, we compared the features and performance of both tools. We analysed the performance of Entity Framework and NHibernate for two different databases (MS SQL Server and PostgreSQL), different query languages (lambda expressions and LINQ for Entity Framework and HQL and Critera API for NHibernate) and compared the results with the standard SqlClient queries. The results show that there is no significant difference between these both tools and we proved that common opinion that NHibernate performs better than Entity Framework is incorrect.
KeywordsObject-relational mapping ORM .NET framework Entity Framework NHibernate MS SQL Server PostgreSQL performance analysis
Unable to display preview. Download preview PDF.
- 1.NHibernate 3.3.1 (2013), http://nhforge.org/
- 2.Barnes, J.: Object-Relational Mapping as a Persistence Mechanism for Object-Oriented Applications. Master’s thesis, Macalester College, Saint Paul, Minnesota, USA (2007)Google Scholar
- 3.Bhatti, S., Abro, Z., Rufabro, F.: Performance evaluation of java based object relational mapping tool. Mehran University Research Journal of Engineering and Technology 32(2), 159–166 (2013)Google Scholar
- 5.Doomen, D.: Entity framework 5/6 vs nhibernate 3 – the state of affairs (2013), http://www.dennisdoomen.net/2013/03/entity-framework-56-vs-nhibernate-3.html (accessed December 2013)
- 6.Entity Framework team: Entity framework 5.0 (2013), http://entityframework.codeplex.com/
- 7.Fowler, M.: Ormhate (2013), http://martinfowler.com/bliki/OrmHate.html (accessed December 2013)
- 8.Marguerie, F.: Choosing an object-relational mapping tool, http://madgeek.com/Articles/ORMapping/EN/mapping.htm (accessed December 2013)
- 9.Microsoft Corporation: Microsoft SQL server 2012 (2013), http://www.microsoft.com/en-us/sqlserver/
- 10.Płuciennik-Psota, E.: Object relational interfaces survey. Studia Informatica 33(2A), 299–310 (2012)Google Scholar
- 11.The PostgreSQL Global Development Group: PostgreSQL 9.3.2 (2013), http://www.postgresql.org