Slimming Down for 2009: Reduce the Size of your XAP Files up to 70% with XapOptimizer
Applies To:
Studio Enterprise
Author:
Chris Meredith
Published On:
2/9/2009
With the release of Silverlight, Microsoft has introduced an entirely new way to develop Web applications. But with new technology comes new concerns that developers must keep in mind and Silverlight is no exception. When a user browses to a Silverlight site they need to download the application (XAP file); therefore, the larger the XAP file the longer the time it takes to download and initialize the Silverlight application. At the same time, you need to follow good design and maintenance practices in your development process. Applications are usually packaged in different libraries, which are reused across several projects. This sometimes results in unused code, which consumes both server and client bandwidth and time. Now, what if there was an option to optimize your XAP file? A way to trim down the size of your XAP file with no loss in functionality. Something that could shrink your libraries when you don’t know what is being used and what's not. Well, now you can with ComponentOne XapOptimizer.
ComponentOne XapOptimizer is stand-alone utility that processes your XAP files and generates an optimized Silverlight application up to 70% smaller than the original XAP file size. Without any loss in functionality, you get an application with improved start-up time, thus reducing network traffic. Along with optimizing the size you XAP file, XapOptimizer also has the option to obfuscate your code. Now let's take a look at XapOptimizer in action.
We are going to take a look at one of the samples that comes ComponentOne Studio for Silverlight: OlympicTracker. This sample uses our Silverlight grid, chart, and map control to display medals won in the 2008 Olympics.
Step 1: Upload your XAP File
Let's run this sample through XapOptimizer and check the results. To do that, simply browse out to the XapOptimizer page, http://demo.componentone.com/Silverlight/XapOptimizer/, select the XAP file you want optimized, and an email address you want the XAP file sent to. There is also an option to obfuscate the code if you choose to.
Step 2: XapOptimizer Processes File and Delivers Results
Now that we have run the sample through XapOptimizer let's take a look at the results.
OlympicTracker Sample: Original size: 1,291 KB ----> After XapOptimizer: 934 KB ----> After XapOptimizer (with obfuscation): 926 KB
With no loss in functionality, the XAP file has been reduced by 28%. A full one-fourth reduction in the size of the file!
Here are the results from running other sample projects through the XapOptimizer.
SalesBook Sample: Original size: 887 KB ----> After XapOptimizer: 480 KB ----> After XapOptimizer (with obfuscation): 477 KB ----> Reduced by… 46%
Factories Sample: Original size: 572 KB ----> After XapOptimizer: 356 KB ----> After XapOptimizer (with obfuscation): 352 KB ----> Reduced by… 38%
"The ComponentOne XapOptimizer is cool. We optimized 1MB file and it was reduced to 500Kb. Good Job!" -Ivan Dragoev, Product Manager, SilverlightShow
"Wow... It almost HALFED the size of my application and works perfectly. This is amazing." - Jerrod Horton, Software Engineer, Extreme Silverlight Products
In this article we have shown the benefits that XapOptimizer offers by reducing the size of XAP files. A smaller XAP file leads to quicker downloads and start-up time which in turn leads to less network traffic and happy end users. Another benefit is that XapOptimizer is a standalone utility; therefore, XapOptimizer can be added to the build process which leads to automated XAP optimization. Take advantage of XapOptimizer today by trying it out for free.