| Abstract: This article presents benchmarking results of performance of SP calls using LINQ, Data-access application block and ADO.NET. Some time ago I was doing LINQ performance benchmarking, looking for an option of replacing our existing data layer with it. One thing that was especially important for me to check - was performance of executing SP's. The reason is that most of our DAL logic resides in SP's at one hand and that performance-critical parts are implemented as SP's as well (for all the good reasons, like possibility to benefit from queries compilation etc). Below are performance benchmarking results of execution uspGetManagerEmployees SP from AdventureWorks DB. (Basically it does some sort of JOIN to retrieve records of employees data for the specified Manager ID). I tested three data-access models - raw ADO.NET vs. DAAB (our current DAL workhorse) vs. LINQ (May 2006 preview version). As a prerequisite for running this test you'll need AdventureWorks DB and installation of LINQ. Few side-notes:
So here goes the test code: 1. Plain ADO.NET:
2. DAAB (Data Access Application Block):
3. LINQ (using ORM layer produced by SQLMetal.exe - "c:\Program Files\LINQ Preview\Bin\SqlMetal.exe" /server:. /database:AdventureWorks /pluralize /sprocs /code:AdventureWorks.cs):
Here are timing results of this benchmarking test:
![]() Results So, comparing to the raw ADO.NET - DAAB is 8% slower and LINQ is 28% slower. Comparing to DAAB - LINQ is 18% slower. CPU usage intensity is about 2% average for raw ADO.NET vs. about 8% for DAAB vs. about 20% for LINQ - order of magnitude worse than raw ADO.NET (CPU graphs captured with perfmon below). ![]() Fig. 1 ADO.NET - CPU usage ![]() Fig. 2 DAAB - CPU usage ![]() Fig. 3 LINQ - CPU usage In overall - this performance overhead is quite disappointing. I still consider to use LINQ, as we have DAL/BLL servers in our architecture, which we may merely upgrade to faster hardware, while isolating thin-client computers from this performance overhead. I think it's a big challenge for the LINQ team to address its performance. |
Showing posts with label Design. Show all posts
Showing posts with label Design. Show all posts
Monday, July 16, 2007
Benchmarking LINQ vs. DAAB vs. ADO.NET
Thursday, March 22, 2007
Weakest chain amplification principle
| What I going to say is actually obvious- but somehow I never thought that the common sense proverb saying "the chain is as weak as its weakest link" is wrong. Really, when you hear it you may visually imagine a chain with a weak link which tears when disruptive force applied to it is much weaker than force needed to disrupt the rest of chain links. So, what's wrong? The wrong thing is that this proverb usually not being applied to the physical chains. It applies to the chain of circumstances, probabilities or responsibilities. In fact the chain is much weaker than its weakest link. Really, let's say we are talking about a transportation system in some city. If there is a chance of 50% that your autobus will late and a chance of 50% that your train will late there is a chance of only 25% that you will arrive at time. So, if you're looking at set or related factors where each of them has low failure probability the overall failure probability is much higher. I call it "weakest chain amplification principle". I think this fact has interesting consequences in a lot of fields. For example in sociology: next time you hear about a 'weak chain' in politic, public sector, police, health system or whatever else you should realize that the overall situation is much worse than this 'weak chain' issue. If some politician is a bit not professional, another one does something a bit not completely legal and another one is a bit dumb all together they form a government that is not a bit weak, but really weak. Of course - all above applies only when elements or factors are strongly related, i.e. when they are actually bound into 'chain'. And this, in turn, has some interesting implication in creation of complex systems, e.g. in software development. The thing is that, taking a SW development as an example - we may note that any big software complex has its own weak chain (bugs, design mis-considerations, etc), even in its final stage. Then - why at all those big programs are able to work? Considering all said above - it should be impossible to create a stable SW product in principle. How they work then? Well, they work since usually, after some polishing - bugs became kind of sparsely spread around and not related to each other. Theyhappen in certain conditions and with relatively low probability. And then the weakest chain amplification principle doesn't apply to them. p.s. Small note there is an obvious connection between above considerations and 'explicit boundaries' and 'autonomous evolution' principles in SOA. |
Monday, August 22, 2005
How interception affects performance in .NET
Recently I prepared a lecture on AOP & interception in .NET for my collegues. As part of a lecture I created a small demo to demonstrate how interception could affect the performance of the intercepted code. My original estimation was to obtain result similar to one, obtained in that nice article (slowdown upto 300% with ~~0,022 microsecond per call). My test shows a quite different numbers - slowdown by 1099 times with timing of about ~~19 microsecond per call. The only difference is that I created a complete simple AOP scenario with context attribute, context property and a message sink (all of a no-op style). Full test code is below ...
|
Subscribe to:
Posts (Atom)



