Home > Actionscript, Adobe, FMS, Flash, Flash Builder 4, Flash Platform, Flex, Information, Programming, RIA, Red5, Web Development > Optimizing Your Code And Increase Application Performance

Optimizing Your Code And Increase Application Performance

When any software development start then development team target finish the development within the timeline. And to achieve the target in less time developers have only one option to compromise with development standards and code optimization.

But I think code optimization is most important factor which should be considered at the time of development. And for that following are some common rules:

1) If possible then we have to use native methods instead of user defined methods. Because in execution native methods are faster than user defined methods.

2) It very normal thing we can observe from our code if we are using a for loop and we want to execute the loop (Array.length) number of time. Then before the loop we should have to assign Array.length to a variable and then will have to use the variable in the loop.

var _arrayLength:Number = itemArray.length;
for (var i:Number =0; i< _arrayLength; i++)
{
trace(itemArray[i]);
}

3) We should also think on optimizing loops from our codes. Some loops (let say setInterval()) will take lots of processing time of application. And if we are using function like setInterval() then we should remove it.

4) If possible then we should use local variables instead of global variables. Because local variables will be destroyed when its scope is finished.

There are several other rules by which we can improve performance of our application.

So enjoy RIA with optimized code :)

  1. No comments yet.
  1. No trackbacks yet.