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/

 

34 comment(s)
Anonymous
Twitter Trackbacks for 4 Settings To Improve DevExpress ASP.NET Performance - The ASPx Blog - Mehul Harry's DevExpress Blog [devexpress.com] on Topsy.com

Pingback from  Twitter Trackbacks for                 4 Settings To Improve DevExpress ASP.NET Performance - The ASPx Blog - Mehul Harry's DevExpress Blog         [devexpress.com]        on Topsy.com

4 September, 2009
Joe Hendricks
Joe Hendricks

Wow! Pretty impressive page load optimization!

4 September, 2009
heather
heather

I can't wait to try this stuff...

4 September, 2009
Anonymous
Peter Thorpe

I know what I will be trying Monday morning.

4 September, 2009
Anonymous
Charles

I implemented on a large application that I am working on and it works great.  The whole application is much more user responsive.

The only issue that i am coming up with is that now all my grids that export and throwing the error "unable to read file" on export. (Most use excel).  

6 September, 2009
Crono
Crono

It's cool, but you ***REALLY*** must remove those settings from the AppSettings collection. You may break existing apps otherwise.

6 September, 2009
Stefan Wolf
Stefan Wolf

I've tried it this moment. Very impressive.

Small, fast - and the best of all - easy to use!

7 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Heather and Peter,

Thanks, let us know the results. :)

7 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Crono,

Thanks and your previous suggestion about the AppSettings will be reviewed by the team.

7 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Thanks Stefan.

7 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Charles,

About the error, please report it to the support center so the team can investigate it and find a resolution for you:

www.devexpress.com/.../CreateIssue.aspx

And glad to hear you like the upgrades.

7 September, 2009
Anonymous
Sebastià  Prat

Hi Mehul,

We're gonna try it in a website that receives about 10.000 visits every day. I give you feedback

7 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Sebastià,

Thanks, looking forward to it. Btw, please email me directly as well: mharry at Devexpress

I'd like to learn more about your website.

7 September, 2009
David McLaughlin
David McLaughlin

Hi Mehul,

What if your using DevExpress components as part of a server control? Will the same logic work or does it require setting specific properties on the controls themselves?

7 September, 2009
Anonymous
Murilo

Great!

8 September, 2009
Anonymous
Peter Thorpe

Since I couldn't set the IIS compression on the server I am using for my intranet site. I had a bit of code in the Global.asax file Application_PreRequestHandlerExecute method.

I won't put the whole method but it basically uses

app.Request.Headers["Accept-Encoding"]; and compresses the site to deflate, gzip or non dependant on what the browser can handle.

Should I keep using this or use

<add key="DXEnableHtmlCompression" value="true"/>?

i'm assuming this web.config option will only apply to dx components so I should keep using my method to compress the whole site.

9 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Peter,

Yes, the 4 DX options above pertain to our controls only.

9 September, 2009
Anonymous
Paul van Tonder

Hi

i am in awe, this is one brilliant discovery ...

i have adapted all our applications and it is now lightning fast.

Thanks to all the DevExpress team, BRILLIANT work !

10 September, 2009
Anonymous
Adam S

Those 4 settings improved the speed of my site a lot,

But it broke the xtrareports save to pdf feature. I got an error saying the pdf was corrupted.

10 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Thanks Paul van Tonder.

10 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Adam,

Thanks and I recommend contacting support and they can help you work through the export issue.

10 September, 2009
Evgeniy Meyke
Evgeniy Meyke

Adam, it is already reproduced

www.devexpress.com/issue=B140012

10 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi David,

It should be fine. Let us know if you have any issues.

10 September, 2009
Anonymous
DotNetBurner - ASP.net

DotNetBurner - burning hot .net content

12 September, 2009
Ferret
Ferret

The major deterrent from using DevExpress ASP.NET components in the past was the unacceptable bandwidth bloat they produced. It looks like it's time to give them another try :)

13 September, 2009
Anonymous
Dmitry

It works great! ty.

15 September, 2009
Anonymous
Donn Edwards

Does the compression mess with Google, Bing or other search engines in any way? What happens if a browser doesn't understand compression? I'm sure IE5 has no idea about it. Which browsers don't work? I have tested my site with IE5, IE6, Opera 9 as well as newer browsers. I'd hate to have to exclude some browsers.

16 September, 2009
Anonymous
Gabriel

I was just wondering, there've been more switches to get everything faster... Can anyone point me to the relevant posts?

17 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Gabriel,

You can always search on the 'performance' tag for this blog:

community.devexpress.com/.../default.aspx

However, these 4 settings are all you need (for now). Smile

17 September, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Hi Donn,

I don't believe it should have any effect on Google because the end result is still HTML and my guess is that their servers probably know how to handle compressed bytes. For example, gmail can show you an online preview of enclosed zip files, pdfs, etc, w/o downloading them first.

If you do have trouble with certain browsers not understanding compression then it's up to you to decide if you want to keep the feature on and support the older browsers or request that the client upgrade. Smile

18 September, 2009
Huang Tonney
Huang Tonney

I accordance with the "www.devexpress.com/.../Q235648.aspx" set Webconfig,

, and enabled IIS compression,

when i calling "ASPxGridViewExporter.WriteXlsToResponse("中文chinese",false);" to export file

then this file cant`t be opened to read.How to solve?

My hotmail is tonneyforwork@hotmail.com

1 November, 2009
Mehul Harry (DevExpress)
Mehul Harry (DevExpress)

Huang,

Please contact our support team and they can help you:

www.devexpress.com/.../CreateIssue.aspx

1 November, 2009
Guilherme Soares
Guilherme Soares

I've tested the tips quoted above and they worked perfectly! Especially when you are accessing the application through WAN, bandwidth is more than an issue you must deal: it is the vital point of your app.

Thanks a lot!

6 November, 2009
Crono
Crono

Thank you so much! :D

6 May, 2010

Please login or register to post comments.