4 Settings To Improve DevExpress ASP.NET Performance

ASP.NET Team Blog
04 September 2009

Hang on to your seats, I’ve got more good news about the ASP.NET controls performance in the DXperience 2009 volume 2 release. We’re giving you four web.config settings for HTML compression that dramatically improve website performance. First, let’s take a look at the numbers.

Speed Comparison

Using our custom HttpHandler, the performance numbers for the DXperience 2009 volume 2 release are amazing. Let’s compare the difference with the DXperience 2009 volume 1 release. For benchmarks, we used the Fiddler2 tool again and got the following impressive results:

image

Page load time is reduced from 21.7 to 5 seconds ! That’s about 4.3 times faster on the 512 kbps connection used to test in Fiddler2.

HTML output is 5 to 7 times smaller! The page size is reduced from 324K to 41K - about 7 times less.

The Settings

To get the all the benefits of HTML compression and resource merging from the DXperience 2009 volume 2 release, set these four settings to true in your web.config file:

<configuration>
  ...
  <devExpress>
    <compression enableHtmlCompression="false" 
                 enableCallbackCompression="true" 
                 enableResourceCompression="true" 
                 enableResourceMerging="false" />
    <themes enableThemesAssembly="true" />
    <errors callbackErrorRedirectUrl="" />
  </devExpress>
  ...
</configuration>
  • enableHtmlCompression – Compresses HTML output to the client browser including AJAX callbacks. This option is disabled by default. If this option is set to true, the value of the Callback Compression option is not in effect.
    • To compress individual pages, use the DevExpress.Web.ASPxClasses.ASPxWebControl.MakeResponseCompressed() method.
  • enableCallbackCompression – Compresses AJAX callbacks. This option is enabled by default. This option's setting is not in effect, if the Page Html Compression option is set to true.
  • enableResourceCompression – Compresses scripts and CSS files. This option specifies whether resources (script and CSS files) are compressed by the server before posting to the client. The reduced size is about 20% of the original size (i.e., reducing it by a factor of 4-5). This option is enabled by default.
  • enableResourceMerging – This optioin specifies whether resources (script and CSS files) from different assemblies are combined in the following manner, to be sent to the client: all scripts that are required by the requested page are combined in one file, and all required CSS files are merged in one file.

    This feature helps reduce the number of requests to the server. This option is disabled by default. 

    Enabling this option might make sense if your web application has a few web pages that use different DevExpress web controls, or most of the pages use the same set of DevExpress web controls.

Starting with version 2010 volume 1, a DevExpress specific section is automatically created within the web.config file, when any DevExpress web control is placed from the Visual Studio toolbox and onto a web page using the designer.

HTML compression has one shortcoming - a client browser will only display a compressed webpage after the page is completely loaded to the client. Consider the zipped file analogy. A zipped file has to be unpacked before you can view its contents.

This brings up an interesting question, what kind of load does compression put on the server and the client?

Bandwidth vs Processor

Compression has a small trade-off. Compression requires that both the server and client use more CPU cycles. After all, compression is the process of encoding information using fewer bits.

On the other hand, compression has major advantages like faster websites and less bandwidth. So which do you choose?

Simple, choose to save bandwidth and speed up your website. Bandwidth is expensive and processors cost very little comparatively. In fact, modern processors are fast and versatile enough to easily handle HTML compression requirements.

Besides ISP bandwidth costs, speed is also important for a website. Major sites like Google, Yahoo and Microsoft understand this. If your website takes too long to load then the visitors are more likely to leave. Therefore, you should consider website speed a factor for user experience on the web (search on Google).

IIS Compression

We’ve done some tests to see how the IIS compression feature and the four optimizations work together. We didn’t find any unusual behavior since everything worked as expected.

The DXperience ASP.NET controls offer a ton of functionality and styling while still being performant! So it’s hard to imagine that even more performance could be squeezed out the controls. But, that’s exactly what we’re going to attempt in the DXperience 2009 volume 3 release when we tackle CSS Image Sprites!

Powered by DevExpress ASP.NET Controls

I’d love to hear what kind of performance gains you experience with the DXperience 2009 volume 2 ASP.NET controls? Drop me a line below and feel free to post your DevExpress-powered website URL.

DXperience is a royalty-free tool suite for rapid business application development for WinForms and ASP.NET apps.

Instantly enhance your WinForms and ASP.NET apps by dropping in new feature sets encapsulated in components. DXperience contains:

  • IDE Productivity Tools - Make Visual Studio easier and more effective with IDE enhancements
    • DXCore - IDE tools extensible engine
    • CodeRush - Extensible swiss army knife of tools to make source code editing faster and easier, including code editing templates, code editing utilities (selection, navigation, clipboard), inline code visualizations and the upcoming unit test runner.
    • Refactor Pro - Code editing tools specifically geared for refactoring source code.
  • XAF - Business app framework for WinForms and ASP.NET
  • XPO – Object-relational mapping for .NET
  • Reporting - Reporting "platform" for WinForms and ASP.NET
  • UI Components for WinForms, ASP.NET, WPF and Silverlight

Try a fully-functional version of DXperience for free now: http://www.devexpress.com/Downloads/NET/

 

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.