Data Access

Aug 2, 2012 at 6:34 PM

Hi,

Dapper is a single file you can drop in to your project that will extend your IDbConnection interface and will be ease to use any Database on nHydrate.

I sugest to use the Dapper as a Low Level access of nHydrate or as base to implement many Databases.

It is very high performance.

http://code.google.com/p/dapper-dot-net/

Performance of <tt>SELECT</tt> mapping over 500 iterations - POCO serialization

Method Duration Remarks
Hand coded (using a <tt>SqlDataReader</tt>) 47ms
Dapper <tt>ExecuteMapperQuery<Post></tt> 49ms
ServiceStack.OrmLite (QueryById) 50ms
PetaPoco 52ms Can be faster
BLToolkit 80ms
SubSonic CodingHorror 107ms
NHibernate SQL 104ms
Linq 2 SQL <tt>ExecuteQuery</tt> 181ms
Entity framework <tt>ExecuteStoreQuery</tt> 631ms

 

Performance of <tt>SELECT</tt> mapping over 500 iterations - dynamic serialization

Method Duration Remarks
Dapper <tt>ExecuteMapperQuery (dynamic)</tt> 48ms
Massive 52ms
Simple.Data 95ms

 

Performance of <tt>SELECT</tt> mapping over 500 iterations - typical usage

Method Duration Remarks
Linq 2 SQL <tt>CompiledQuery</tt> 81ms Not super typical involves complex code
NHibernate HQL 118ms
Linq 2 SQL 559ms
Entity framework 859ms
SubSonic <tt>ActiveRecord.SingleOrDefault</tt> 3619ms

 

Performance benchmarks are available here: http://code.google.com/p/dapper-dot-net/source/browse/Tests/PerformanceTests.cs ,

See also,

Simple.Data :

https://github.com/markrendle/Simple.Data/

http://blog.markrendle.net/2010/08/05/introducing-simple-data/

Massive:

http://blog.wekeroad.com/helpy-stuff/and-i-shall-call-it-massive

ServiceStack.OrmLite:

https://github.com/ServiceStack/ServiceStack.OrmLite

 

Coordinator
Aug 3, 2012 at 1:55 PM

This is very interesting but I do not think it applies. We have built an extension for Entity Framework. We do not control the data access as we have delegated this to EF. This API is nice for loading POCO objects but that is a minor feature of the framework and is directly tied to the EF stuff. I will look at this because it might apply to some projects where nHydrate is not a fit.