Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs
Database select executions with ORMs Database select executions with ORMs
Database select executions with ORMs
Go Back  Xtreme Visual Basic Talk > > > Database select executions with ORMs


Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2014, 05:10 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default Database select executions with ORMs


I have been testing the difference in speed between an ORM (NHibernate in this case), and standard SQL use With SQLCommand etc. I have a table With 44 MILLION records, and ran a few tests to see the difference in speed. Here are my results:

NHIB Single record by ID: 0,8760876 sec.
NHIB 1000 records by ID: 0,0590059 sec.
NHIB 11269 records by date: 6,2876287 sec.
Normal Single record by ID: 0,0020002 sec.
Normal 1000 records by ID: 0,0010001 sec.
Normal 11269 records by date: 0,0070007 sec.

As you can see, there is quite a significant difference. Selecting >10000 records between 2 dates (the date Field is indexed), takes Close to 1000 times more time when using NHibernate. Is this normal? These results are enough for me to drop NHiberante (or any other ORM) as a tool all together. Any views on this?

EDIT: Actually the first test (NHIB single record) is a bit wrong, as it includes the creation of the NHib session. It should be more like 0,03 sec. But that does not change the problem.

Last edited by JustinCase2; 05-22-2014 at 06:51 AM.
Reply With Quote
  #2  
Old 05-22-2014, 07:03 AM
PlausiblyDamp's Avatar
PlausiblyDampDatabase select executions with ORMs PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Without seeing an actual example of the code used in each case and any details on what you did while testing (e.g. rebooting machines in-between tests etc) it isn't really valid to offer any opinion based on those times.

As a general rule any ORM is likely to introduce a performance hit as it is an extra layer between the code and the data, the figures you are displaying though are pretty awful for NHibernate....

Knowing how to use the tools correctly will have a massive impact on performance though, using any ORM incorrectly is just as bad as writing incorrect SQL by hand.

http://weblogs.asp.net/fbouma/archiv...rameworks.aspx
and
http://weblogs.asp.net/fbouma/archiv...ks-part-2.aspx

are a couple of posts by the author of an ORM (LLBlgen) and he does give quite a good write up on how different ORMs perform and some of the things to do to address these issues. NH doesn't come off very well in his tests either though
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs Database select executions with ORMs
Database select executions with ORMs
Database select executions with ORMs
 
Database select executions with ORMs
Database select executions with ORMs
 
-->