Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Performance Testing Script

By Jesse McLain,

This script helps developers test the performance of a stored procedure or block of code. Although it was written specifically to assist me in comparing stored procedures, it can easily be modified for other testing purposes.

The script expects two tables, 'Seq1' and 'Seq2' to exist, and be of the structure as listed in the header comment of the script. It will test the code of interest by running it using different input sizes, multiple times, and record the performance of each run. The code it tests, as listed in the script, can be found here.

The user should modify the values of these variables:

@RunsPerInputSize - the more runs at each input size, the more consistent the results

@InputSizeIncrement - the algorithm will start at this input size and also increment by it

@TotalNumberIncrements - the total number of different input sizes to test

For example, with @RunsPerInputSize = 2, @InputSizeIncrement = 50, and @TotalNumberIncrements = 3, the testing script will run the code to be tested with the following input sizes, in this order: 50, 100, 150, 50, 100, and 150.

Written by Jesse McLain

www.jessemclain.com

http://jessesql.blogspot.com

Total article views: 8911 | Views in the last 30 days: 6
 
Related Articles
BLOG

PowerShell-Input-Validation Scripts

Input values are validated using various mechanisms.  let’s start by examining how you would validat...

BLOG

PowerShell-Input-Validation Scripts

Input values are validated using various mechanisms.  let’s start by examining how you would validat...

BLOG

PowerSQL – Find OS and Memory Usage Details – Multi Server Script – No Input files

Multi Server script to find OS and Memory details.  It doesn’t require a text file as its input but ...

FORUM

Sport Lap time Input

Inputting sport times

SCRIPT

Unused Input Parameters

Identify all objects containing unused input parameters.

Tags
performance testing    
t-sql    
 
Contribute