Combining Client Scripts into a Composite Script could kill the website performance

It’s a good practice to reduce the number of files by combining them into one file using bundling to increase the website performance.

You can use <CompositeScript> which is a control in ASP.NET AJAX by placing all JavaScript files inside this tag as following:

03

But the issue with this way , that each time the page is loaded , bundling will occur at run time to combine these files into one file and this could affect the performance in case you have heavy load or visits in your websites.

I did a performance test against SharePoint website (10000 load test within 1 Min) using loader.io and the result was Scary.

Result #1: With using <CompositeScript>

It didn’t continuous because the Number of failed requests more than 50% of Success requests

01

Result #2:without using <CompositeScript>

The number of Success requests more than first test

02

Result #3: Bundling the files Manually into one file or using Web Essentials tool with Visual studio

The result , no comparison between this result and the previous results

03

So it’s good practice to bundle the files globally one time at the application start by code , manually or by using tools like Web Essentials

(This extension for Visual Studio 2012) https://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-4e15-becb-6f451ea3bea6

(This extension for Visual Studio 2015)
https://visualstudiogallery.msdn.microsoft.com/ee6e6d8c-c837-41fb-886a-6b50ae2d06a2

 

Advertisements

One thought on “Combining Client Scripts into a Composite Script could kill the website performance

  1. Pingback: Maximizing Website Performance | Fadi Abdulwahab

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s