Welcome to Bangladesh Microsoft Technology Community Sign in | Join | Help
While we develop AJAX applications, we often carelessly ignore giving up bad practices, which cause effects which are not so significantly visible when the site is not so large in volume. But, it’s often severe performance issue when it is the case for Read More
Don't you think the following block of code has written keeping every possible good practice in mind? Any option for performance improvement?function pageLoad() { var stringArray = new Array(); // Suppose there're a lot of strings in Read More
Take a look at the following loop. This loop calls a function in each iteration and the function does some stuffs. Can you think of any performance improvement idea?for(var i=0; i<count; ++i) processElement(elements); Well, for sufficiently large Read More
We have seen DOM caching before and function delegation is also a kind of function caching. Take a look at the following snippet:for(var i=0; i<count; ++i) $get('divContent').appendChild(elements); As you can figure out the code is going to be Read More
Unlike .NET languages or any other compiler languages, JavaScript interpreter can not optimize switch block. Especially when switch statement is used with different types of data, it's a heavy operation for the browser due to conversion operations occur Read More
In one of my earlier posts, I talked about DOM element accessing in a loop but forgot to talk about a very common, yet performance issue in AJAX. We often use code like the following:var items = []; // Suppose a very long array for(var i=0; i<items.length; Read More
Make minimum use of setters and getters if possible. Such accessors look like .NET like kind of beautiful properties, but these create new more scopes for JavaScript interpreter to deal with. If applicable, try directly setting/getting the private variable Read More
It's not pretty common. But, if you ever encounter such code, be sure it's a very bad practice. Introducing more scopes is a performance issue for JavaScript interpreter. It adds a new scope in the ladder. See the following sample scope:function pageLoad() Read More
Avoid implementing your own getElementById method that will cause script to DOM marshalling overhead. Each time you traverse the DOM and look for certain HTML element requires the JavaScript interpreter to marshalling script to DOM. It's always better Read More
It's a very common bad practice. We often iterate through array, build HTML contents and keep on concatenating into certain DOM element. Every time you execute the block of code under the loop, you create the HTML markups, discover a div, access the innerHTML Read More