Performance Issue Of ClientSide Script with Loop and Calculations

Last post 06-22-2009 3:15 AM by XIII. 1 replies.

Sort Posts:

  • Performance Issue Of ClientSide Script with Loop and Calculations

    06-22-2009, 12:31 AM
    • Member
      point Member
    • aoriju
    • Member since 06-18-2009, 6:28 AM
    • Posts 28

    Dear All,

    I have a Javascript contains a forloop with 400 times of Iteartions with some basic calculations.But it takes too delay.

    I would like to know whih one is faster(same can be written into C# with Ajax) -which one is faster and what is the reason behind it....

    Thanks & Regards

    Riju A.O 

     

  • Re: Performance Issue Of ClientSide Script with Loop and Calculations

    06-22-2009, 3:15 AM
    Answer
    • All-Star
      124,769 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,760
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    in IE8 you have the new developer toolbar integrated with which you can profile your javascript. The same can be done with firebug (a free extension to firefox). Profile it and take a look which functions get called the most, then optimize.

    C#, in ASP.NET, runs on the server while your javascript runs in the browser. IE6 is known to be leaky on that part and quite slow. Most modern browsers are made with javascript performance in mind (thanks to ajax usage). So you could indeed see a performance gain when you do the calculations on the server and get the output of it via a webservice call via ajax.

    But still you can first try to optimize your javascript.

    Grz, Kris.

Page 1 of 1 (2 items)