Click here to monitor SSC

Laila Lotfi

.NET tools Brand Manager & Simple-Talk Editor

Speeding up AJAX Applications

Published Thursday, October 08, 2009 6:04 PM

Microsoft's recent release of Doloto reminded me of the pain of the AJAX Programmer. Doloto is a tool for optimizing an AJAX application by analyzing its workload and splitting the code so that the application will start by transferring only the portion of code necessary to initialize. I can see many web programmers wanting to use it.

Although the Outlook web client has proved that it is possible to produce lightweight AJAX-based applications on the browser, last year's report from Forrester Research confirmed the high level of disappointment with the performance of AJAX applications. Since then, Silverlight and Flex have somewhat improved the reputation of Rich Internet Applications (RIAs), but one cannot help but think that the disillusionment with AJAX was more due to the way in which the technology has been misused, than any intrinsic problem with the technology.

According to the Forrester report, there have been several problems, a few of which were, to some extent, out of the AJAX developers' hands. For example, certain virus scanners investigate each line of JavaScript as it is run, thus degrading the rendering performance of the browser.

However, in other cases, poor implementation was to blame. Some AJAX applications were leaving all business logic, such as input validation, to the server to implement, requiring a roundtrip AJAX communication between the browser and server for each input field: up to 50 fields for a screen. In other cases, heavyweight frameworks were being used that required the loading of bulky JavaScript libraries and featured unnecessary animation and cute widgets. The worst problems seemed to be the transmission and parsing of bulky uncompressed XML data files.

One can, perhaps, blame some of the problems on the way that certain vendors implied that desktop applications could be easily ported to the browser, using DHTML and AJAX. Oh no. There are inherent limitations with browsers, and JavaScript has to be used abstemiously, with the respect required for a slower, usually interpreted, language. Even the X in AJAX, XML, proved to be a bottleneck when data sizes swelled. Web programming requires a different mindset.

Although one can remove some of the symptoms of framework-bloat by using Content delivery networks (CDNs) to deliver the bulky JavaScript frameworks, the best way of improving any AJAX application - almost any application in fact - is to measure, to profile, and to understand where the performance hotspots are.

Tools such as Firebug for JavaScript and ANTS Profiler for server-side assemblies allow you to collect as many metrics as you need in order to find out where the problems lie. You can then make an educated choice about where to focus your optimization efforts, concentrating on creating a good user experience, and cutting out both unnecessary database access and wasteful JavaScript routines. Before profiling tools arrived, web development was an uncertain art, with far less control than was enjoyed by .NET developers. With a lot of the uncertainty removed, perhaps we'll soon see better use of the remarkable frameworks that exist for developing Rich Internet Applications.

Cheers,

Laila

by Laila

Comments

 

Jason Haley said:

Interesting Finds: October 9, 2009
October 9, 2009 8:28 AM
 

Twitter Trackbacks for Laila Lotfi : Speeding up AJAX Applications [simple-talk.com] on Topsy.com said:

October 9, 2009 10:32 AM
 

BuggyFunBunny said:

>>  Some AJAX applications were leaving all business logic, such as input validation, to the server to implement,

Not a problem, in fact the whole reason to use AJAX:  turn the web into a bunch of VT-100's attached to *nix databases (well, and maybe windows, too).  With sufficient bandwidth, it will happen.  And will make maintenance a snap.  No more shipping new code out to clients.  All in one place.


>>  The worst problems seemed to be the transmission and parsing of bulky uncompressed XML data files.

That's why "the silliness of all things xml" is in my blog.  Compressed or otherwise, xml is the albatross around the necks of developers today.  They were (mostly) young-uns who were hoodwinked.


>> Web programming requires a different mindset.

The web browser, as programming paradigm, is just the 3270 with pixels.  In other words, 1970.  No progress there, a block-mode disconnected interface.  The allure of AJAX is to get back to the 1990's:  a character mode connected interface; which permits moving both data and its logic to one place, the server, not bits and pieces scattered all over the world.
October 11, 2009 2:02 PM
You need to sign in to comment on this blog

About Laila

I'm working for the .NET Tools division at Red Gate. These days, I'm spending most of my time working on SmartAssembly (.NET obfuscator, error reporting and feature usage reporting tool), and I'm currently looking to speak to anyone who has used the product for its error reporting technology. My email address: editor@red-gate.com
<October 2009>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
How to Kill a Company in One Step or Save it in Three
 The majority of companies that suffer a major data loss subsequently go out of business. Wesley David... Read more...

Migrating from OCS 2007 R2 to Lync: Part 4
 Having migrated the rest of our users and legacy resources across and started getting ready to... Read more...

Automated Script-generation with Powershell and SMO
 In the first of a series of articles on automating the process of building, modifying and copying SQL... Read more...

Seth Godin: Big in the IT Business
 Seth Godin has transformed our understanding of marketing in IT. He invented the concept of 'permission... Read more...

Using SQL Test Database Unit Testing with TeamCity Continuous Integration
 With database applications, the process of test and integration can be frustratingly slow because so... Read more...