background preloader

.NET Tuning and Performance

Facebook Twitter

(2) Career Advice: At age 25, would you pursue a good paying corporate job that makes you unhappy or a hobby that makes you happy but has no guarantee to pay the bills. How not to do dependency injection - the static or singleton container. Dependency injection and the use of IoC containers is becoming more and more popular but many development teams do not have the knowledge or experience necessary to fully utilise the power of the IoC container.

How not to do dependency injection - the static or singleton container

Tutorial - Creating a Hello World ServiceStack Web Service. This tutorial will go through and develop and call a simple Hello world Web Service from scratch using Service Stack and VS.NET.

Tutorial - Creating a Hello World ServiceStack Web Service

Installing via NuGet If you have NuGet you can skip steps 1 - 3 below by installing one of the NuGet Host packages below: Install ServiceStack Only at root path / ASP.NET Compatibility Mode - Wenlong Dong's Blog. Table of Content: Introduction ASP.NET HTTP Pipeline Two Modes · Mixed Transports Mode.

ASP.NET Compatibility Mode - Wenlong Dong's Blog

Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series) This is the seventh in a series of blog posts I’m doing on the upcoming VS 2010 and .NET 4 release.

Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series)

I’m going to switch from discussing new VS 2010 tooling features and instead do a few posts covering a few new runtime features (don’t worry – I’ll come back to a lot more VS features, I’m just trying to mix things up a bit). Today’s post covers a small, but nice, new feature that you can now optionally take advantage of with ASP.NET 4 - the ability to automatically startup and proactively initialize a web application without having to wait for an external client to hit the web server. This can help you provide a faster response experience for the first user who hits the server, and avoids you having to write custom scripts to “warm up” the server and get any data caches ready. ASP.NET Slow on first access. ASP.NET Site Warmup. UPDATE - 12/8/2011 - Project updated and moved to github ASP.NET applications by nature exhibit some degree of delay upon initial access to the site.

ASP.NET Site Warmup

This is due to the nature of the JIT compilation, caching, etc - and most all ASP.NET websites of any size are going to exhibit some amount of delay on that first hit. Now if you've ever done any admin work with Sharepoint, you've most likely used the Sharepoint-specific warmup script to eliminate Sharepoint's extremely annoying first-hit delay. Performance - Why it's so slow when a wcf client connects to the service. WCF First Call Slow. WCF Slow to Start A week or so ago we got reports that our production web application was slow.

WCF First Call Slow

With further testing, we realized that application's performance slowdown was caused by one particular WCF call taking 15 - 30 seconds. The slowness was not consistent either! Sometimes it was less than a second, and the next call it would hit 30 seconds! Code coverage tool for .NET. JetBrains dotCover is a .NET unit test runner and code coverage tool that integrates with Visual Studio.

Code coverage tool for .NET

It is a part of the JetBrains .NET tools family that also includes ReSharper, dotTrace, and dotPeek. Download dotCover 2.730-day free trial (32.7 MB) Compatible ReSharper versions: up to 8.2. AgUnit - Silverlight unit testing with ReSharper - Download: AgUnit 0.7. Copy the extracted files from AgUnit-0.7-for-ReSharper-7.1.zip into the "Bin\Plugins\" folder of your ReSharper installation (default C:\Program Files (x86)\JetBrains\ReSharper\v7.1\Bin\Plugins), create this folder if it does not exist.Delete any previous versions of AgUnit you may have in this folder.

AgUnit - Silverlight unit testing with ReSharper - Download: AgUnit 0.7

"Unblock" the .zip file in Windows before extracting it! Automated Unit Testing of Silverlight 4 & 5 Applications - TestComplete. Introduction This article describes how TestComplete can expose Silverlight applications and get access to their internal objects, their properties and methods.

Automated Unit Testing of Silverlight 4 & 5 Applications - TestComplete

In the article, we explain how to perform automated unit testing of Silverlight applications with TestComplete. The article also contains a sample Silverlight application and a TestComplete project that demonstrates how you can access applications’ internal classes and perform a simple unit test. How I Explained Dependency Injection to My Team. Recently our company started developing a new java based web application and after some evaluation process we decided to use Spring.

How I Explained Dependency Injection to My Team

But many of the team members are not aware of Spring and Dependency Injection principles. So I was asked to give a crash course on what is Dependency Injection and basics on Spring. Instead of telling all the theory about IOC/DI I thought of explaining with an example.Requirement: We will get some Customer Address and we need to validate the address. After some evaluation we thought of using Google Address Validation Service.Legacy(Bad) Approach: Just create an AddressVerificationService class and implement the logic. Assume GoogleAddressVerificationService is a service provided by Google which takes Address as a String and Return longitude/latitude.

Load and Stress Testing in Visual Studio 2012. Now to do some load testing. There’s two types of load testing IMHO – basic run of the mill load testing, where we see how the app performs under a typical usage scenario (with multiple users) – and then there’s stress testing, where we overload it and see where it breaks. OK, so now I’m going to pass against my sample service – create a new Project, and add one test against the URL of your choice.

Removing Function Calls for Better Performance in SQL Server. Problem Everyone knows it's best not to use function calls in your WHERE clause as it will affect your performance (if you did not know this already, this article will convince you not to), but what about using them say in the SELECT list. This tip will look at how removing function calls from the SELECT list can dramatically improve performance, especially when returning larger data sets i.e. search query results. Solution Sample SQL Server Table and Functions For this example we will setup two sample tables and two functions that access these tables. Here is the DDL code: -- Table creation logic CREATE TABLE [dbo]. CREATE TABLE [dbo]. ALTER TABLE [dbo]. Performance and the Entity Framework.

Introduction If you are using the Entity Framework (EF), then you need to understand the best practices for improving its performance, or you will suffer the consequences! Background My team has spent almost 2 years with the first version of the Entity Framework in an enterprise application (including the beta). Our application has a Service Oriented Architecture (SOA) that uses the .NET 3.5 Framework SP1, SQL Server 2008 and IIS 7.0 on Windows Server 2008. LINQ To SQL Query Tuning for Performance Optimization. In my last post: LinqDataSource And How You Can *Maximize* Roundtrips to Your Database I discussed how you can easily misuse LINQ To SQL and bring your application to a crawl by causing performance issues via too many roundtrips to the database when accessing lazy-loaded properties.

Most people familiar with O/R Mappers will recognize that classic problem. I continued exploring how one can better tune the database queries and limit database roundtrips this weekend which resulted in the discovery of DataLoadOptions in LINQ To SQL and several posts: Understanding the benefits of a Dependency Injection Container (IOC) Www.objectmentor.com/resources/articles/dip.pdf. Design pattern – Inversion of control and Dependency injection. Updates added MVC and MVP design pattern tutorial date 19 december 2008 Table of Contents Updated Added link for how to do DI using Unity application bocks. Introduction. Understanding Inversion of Control, Dependency Injection and Service Locator.

What is IoC Container or DI Container. Posted By : Shailendra Chauhan, 14 Apr 2013 Updated On : 15 Apr 2013. List of .NET Dependency Injection Containers (IOC) Design pattern – Inversion of control and Dependency injection. The Repository Pattern. In many applications, the business logic accesses data from data stores such as databases, SharePoint lists, or Web services. Directly accessing the data can result in the following: Duplicated code A higher potential for programming errors Weak typing of the business data Difficulty in centralizing data-related policies such as caching An inability to easily test the business logic in isolation from external dependencies Use the Repository pattern to achieve one or more of the following objectives:

SQL Deadlocks SQL Deadlock Detector - SQL Solutions. SQL Trace Analyzer. Analyze a SQL trace to locate bottlenecks. SQL Trace Analyzer™ is the ultimate tool to diagnose and eliminate performance bottlenecks in SQL Server database applications. SQL Trace Analyzer gives you a clear and complete picture of what goes on inside your database system. On Writing Unit Tests for C# Is it realistic to keep to principles of 'Test-First' and 100% coverage for unit tests when in the heat of developing commercial C# applications?

Code coverage. Code coverage was among the first methods invented for systematic software testing. The first published reference was by Miller and Maloney in Communications of the ACM in 1963.[1] Coverage criteria[edit] Guy Harwood: Solution review and refactoring with NDepend and Resharper. Recently I have been performing a lot of maintenance and improvement tasks on a commercial web product that I built over 6 years ago. Cyclomatic Complexity. Understanding Profiling Methods. Beginners Guide to Performance Profiling. Chapter 17 - Tuning .NET Application Performance.