Git Product home page Git Product logo

orm-comparison's Introduction

ORM Comparison

This project compares ORM code style and performance when executing stored procedures and mapping the results to existing POCOs

Out of scope are any comparisons for mapping the whole database or generate SQL for database interactions. Athough the tests could be expanded to do this if you want.

Setup

I've included a database script for creating the database objects and data.

The tests all work with a single table of 300 records containing Int, String, Datetime, Boolean and Guid. There are 3 stored procedures

  • GetSingleRecord pulls out a single record from the 300
  • GetAllRecords pulls out all 300 records
  • ExecuteNonQuery takes a parameter of each type plus an output parameter (to represent selecting the id of a newly inserted record). It doesn't return anything

The Tests

Using each ORM each Stored Procedure is timed while being executed 5000 times. Before the timed run each Store Procedure is executed 500 times to allow the ORM and Database to warm up.

The Results

As important as speed is the look of the code, but beauty is in the eye of the beholder so you will have to look at the source yourself. Also,take a look at the false starts section below.

Comparison Graph

Orm SelectOne SelectAll RunNonQuery
LinqToSql 00:00:01.9562822 00:00:03.6997025 00:00:01.6399206
EntityFramework 00:00:01.2706107 00:00:03.4185752 00:00:01.7025083
RawDataAccess 00:00:00.4961315 00:00:02.9706760 00:00:00.3808327
Dapper 00:00:00.4071070 00:00:02.5303710 00:00:00.4087079
PetaPoco 00:00:00.6143251 00:00:02.8285628 00:00:00.6723926
NPoco 00:00:01.6210925 00:00:03.4482741 00:00:00.7048360
MicroLite* 00:00:00.4212418 00:00:02.7869338 00:00:00.4328647
Debonair* 00:00:00.5308836 00:00:13.3562763 00:00:00.4040702
ServiceStack.OrmLite 00:00:00.4229755 00:00:02.4594527 00:00:00.4004213

* False Starts

Debonair and Microlite are included in the results, however, there doesn't seem to be a way to get the value of an output parameter using them, so really ... they fail the test.

orm-comparison's People

Watchers

James Cloos avatar James Studdart  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.