Comparing Micro ORM Based on Select command -2

Too long for second part any way, we will just continue , The result are

Query “Select * from trn_mr”

Plain SQL from SSMS

Total Records : 439351
Elapsed time (in sec) : 00:00:13

 

Insight.Database

using openwithtransaction method

initial running
Elapsed time (in sec) : 9.2635298
Total Records : 439351
subsequent running
Elapsed time (in sec) : 7.8354481
Total Records : 439351

using open method

initial running
Elapsed time (in sec) : 13.8457919
Total Records : 439351

subsequent running
Elapsed time (in sec) : 8.1954688
Total Records : 439351

Dapper

Initial running
Elapsed time (in sec) : 14.577856
Total Records : 439351

subsequent running
Elapsed time (in sec) : 5.2883025
Total Records : 439351

using transactionscope

Initial running
Elapsed time (in sec) : 10.0425744
Total Records : 439351

subsequent running

Elapsed time (in sec) : 5.1212929
Total Records : 439351

NPoco

As dynamic resultset

initial running
Elapsed time (in sec) : 22.2962753
Total Records : 439351

subsequent running
Elapsed time (in sec) : 15.7108986
Total Records : 439351

using  gettransaction method

initial running
Elapsed time (in sec) : 16.7779596
Total Records : 439351

subsequent running

Elapsed time (in sec) : 15.9629131
Total Records : 439351

using class object

Initial running
Elapsed time (in sec) : 5.3373053
Total Records : 439351
subsequent running
Elapsed time (in sec) : 5.3253046
Total Records : 439351

 

Overall Insight.Database performance is much more consistent.

While Dapper is Ok , but when used with transaction scope it is lightning speed.

The same applicable for NPoco . It performs better if associated with a class and beats itself if used in association with gettransaction method.

so for now

that’s all folks .

Comparing Micro ORM Based on Select command -1

Off late (pretty late obviously) I am playing with Micro ORMs for .net, When searching for something I saw this post by Jason Brice , which deals with various performance based testing of Peta Poco, Microlite ORM and Dapper. (Everything available as nuget package if you are interested). The test conducted by him deals with inserting some 10K records . Obviously the applications which I am developing will (at least in near future) not going to handle such massive insert activity. So I choose to test the select command , which has been a recurring problem while displaying data.

Disclaimer:

There is no scientific method involved in this test, it is purely based on timers of .net framework only. The results may vary case by case basis.

Data Base:

SQL SERVER 2008 R2

Software:

Visual Studio 2013 Community Edition

Language :

VB

Framework version 4.0

System:

Windows 7 Ultimate 32 bit with 4 gig Ram and Intel i3 processor

Table

The testing table has 21 columns and mixed data types of varchar , datetime and float.

MICRO ORMS USED

I am not going to use Micro Lite ORM instead I am using Insight.Database , which seems to be more easy to handle and has 100% compatible with stored procedures. And Instead of PETAPOCO I am using the active fork of it NPoco , and finally Dapper no change.

TEST SCENARIO

I am just going to use a straight forward select query not optimized, no order by , no where condition and no joins.

The query will be first run on SSMS elapsed time and number of records fetched are noted, then open visual studio web forms application with vb as language.

Create a poco class representing the table. write a small sub routine with the following flow.

 

  • start timer
  • Opening connection
    • if specialized approach requires then use it
  • Execute query and get the result to variable (no data type specified)
  • get the count of the list
  • close the connection
  • stop timer
  • subtract start time from start time get the result in seconds
  • display the result.

I think this is will be ok for a almost test.

The results will be in next section ……………………………..