views:

347

answers:

3

Are there any studies out there about efficiency of Microsoft's ASP.NET Ajax?

+1  A: 

I'm not sure about studies but I've been using it since beta and I would have to say its more suited for intranet type applications where you aren't too concerned with page size or loading times.

If I was building a public facing website I would not use it. I would go with MVC and Jquery or a different platform all together.

Element
A: 

Microsoft's Ajax (specifically the update panel) has some performance issues.

Instead of my trying to explain it it's best to look at this MSDN magazine article.

http://msdn.microsoft.com/en-us/magazine/cc163363.aspx

Specifically Figure 7 shows the sizes of the requests and responses.

Jonathan Parker
+4  A: 

If for some reason you do decide to use the MS Ajax toolkit instead of something along the lines of jquery or yui, there are some things you can do to improve performance significantly.

Enable caching on the script resource handler

In your web.config:

<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression=“true” enableCaching=“true”/>
</scripting>
</system.web.extensions>

Script combining

Use the CompositeScript feature of ASP.NET 3.5 to combine all the MS Ajax scripts into a single file, saving you http requests (this framework generates a ton of them by default!).

<asp:ScriptManager ID=”ScriptManager″ runat=”server” EnablePartialRendering=”false” ScriptMode=”Release” LoadScriptsBeforeUI=”false”>
<CompositeScript>
<Scripts>
<asp:ScriptReference Name=”MicrosoftAjax.js” />
<asp:ScriptReference Name=”AjaxControlToolkit.Common.Common.js” Assembly=”AjaxControlToolkit, Version=3.0.20229.23352, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e” />
.... etc
</Scripts>
</CompositeScript>
</asp:ScriptManager>

To figure out what scripts each of your pages is calling you can use the ScriptReferenceProfiler available on Codeplex.

In terms of whether or not it's sensible using this framework, there are a few things to consider.

As mentioned above, is your app public facing or for an intranet? If it's not being served to the internet, performance isn't as much of a priority.

Is your app developed with webforms or MVC?

If you're using webforms, the MS Ajax toolkit works reasonably harmoniously with that model, especially if you're into the whole RAD drag and drop style development.

Jquery is a much better partner for MVC however, and Microsoft to some extent have acknowledged this themselves as they'll be bundling jquery (and intelisense support) with upcoming versions of visual studio.

MS Ajax is certainly a much heavier framework than many of the alternatives. Another criticism unrelated to performance is that it's something of a black box, and can be difficult to debug.

Bayard Randel
this is very insightful, although it doesn't site any studies on performance. as far as what we are doing, we are developing a public facing site using webforms.
dev.e.loper