I remember a blog where Microsoft Engineer commented that the developers have taken JavaScript to an extreme that the browsers may not be able to support it. In my opinion, that is true - there are many frameworks in the market that are very rich with features and customizable widgets and supports the development of a the rich front application in JavaScript with just the data passed back from the server side.
Few of them are GWT, JQuery, DOJO, YUI ...
In my experience, the advantages and disadvantages of using JavaScript to develop a rich front end applications compared to front ends generated in the server side are:
Advantages
a. Low network bandwidth usage for client- Only data passed over the network, page prepared in the browser. Hence the network bandwidth usage will be less .
b. Supports different browsers and its versions - All frameworks have put in customizations to support various browsers and its versions.
c. Less Server resource utilization - Page formatting is delegated to client side and hence server resource utilization is less.
d. Performance - If the end users have good computers (with enough CPU, Memory ...) and latest browsers, the performance of the JavaScript based page compared to the same page developed using server side technologies will be better.
e. Responsive - With lots of action performed in the browser, without the involvement of a server, pages will be more responsive to user clicks and will be more easily accepted by the end users
f. Richness - This is a real benefit. Some of the richness in the pages that are in the market cannot be easily provided by the server side technologies. For e.g. fading, drag and drop, tree structures....
Disadvantages
a. Client Computer Resource Usage - JavaScript executing in the browser consumes memory as well as CPU of the client machine. Heavy applications can consume around 300MB - 1GB of memory if used for extended period of time. Complex pages can consumes around 35% of the CPU of a quad core machine.
b. Memory Leaks - This is the real killer. Each browser has its own way of Garbage collection - means a leak in IE may not be a leak in Firefox and vice-versa. The frameworks have tons of memory leaks and tweaks put in there to fix them - unfortunately does not fix the leaks always. To verify it yourself, just search for Memory Leak in JQuery bug list and you will find loads of them.
c.Performance - If the client computer does not have enough resources or the resources are consumed by other process like anti-virus, windows update etc ..., the loading of the page will require more time than a page prepared in the server side.
d. Skill Set - Its difficult to get JavaScript developers, who understands the various browser features, browser tweaks required, browser GC processes, Circular Reference between DOM Objects and JavaScript objects and so on..
e. Chattiness - Just because AJAX is supported by the JavaScript frameworks and browsers, developers tend to use lots of AJAX invocations to speed up the page. We need to consider that a server side invocation consumes client and server resources and can indeed negatively impact the performance of the application when working on high latency connections.
f. Single Threaded - As of today, IE or FF or Chrome does not support multi-threaded execution , limiting the options to improve the performance of the application where client computer has enough resources.
Sunday, May 1, 2011
Subscribe to:
Posts (Atom)