Wednesday, June 16, 2010

Minimize Silverlight application size with Telerik Assembly Minifier

assembly-minifier There is one major change in thinking that occurs when you move from ASP.NET or WinForms application development to Silverlight development. Okay, there are a lot of changes in thinking, but one very important change that’s easy to overlook. In Silverlight, your application assembly size matters and has a big impact on user experience!

In ASP.NET, assembly size doesn’t really matter because DLLs always live on the server. Only the final HTML and resources are sent to the user. In WinForms, assembly size can definitely make for a larger install, but generally all of the bits needed to run an app are locally installed and ready to go when the user is ready to begin.

In Silverlight, DLLs live in the XAP. Before a Silverlight application can run, the entire XAP must be downloaded, and if you’ve got a ton of DLLs referenced and in your XAP, that can mean megabytes of download and a slow application “startup” experience for your users. To maximize the Silverlight experience you need to minimize the size of your XAP.

Which leads to the new (free!) tool introduced by Telerik last week, the Assembly Minifier.

When you use 3rd party Silverlight controls, like the RadControls for Silverlight, you should only reference the assemblies for the controls you’re using to avoid adding unnecessary DLLs to your XAP. But that only gets you so far. An assembly like Telerik.Windows.Controls or Telerik.Windows.Controls.Input holds many controls, and using just one brings the rest along for the ride. How do you only “pay for what you use” in your XAP size?

Simply use the Minifier. Today it allows you to quickly “extract” only the controls you’re going to use in your app from Telerik Silverlight assemblies. You just upload your Telerik assemblies, select the controls you want, and then use the new minified output in your project. Depending on the controls you use and assemblies you minify, you can see reductions in uncompressed DLL size greater than 50%. Give the beta a try today and let us know what you think in the forums.

Read all about using the minifier on the Telerik Blogs, too.

How do you make your XAP even smaller?

The Assembly Minifier you see today is just the beginning. As a hosted Silverlight-based tool (which has been minified, too!), we will be constantly updating it leading-up to and then past Q2. We will be working on delivering features in the future that make it even easier to minimize the size of your XAPs, including non-Telerik assemblies! We wanted to start “simple,” though, and then build-up to the “all powerful” minifier we know you need.

For now, enjoy the beta and spread the word. Let’s start minifying Silverlight applications together and start making users’ lives better with radically improved download times!

0 comments: