Tuesday, March 15, 2011

Javascript Performance Optimisation?

Hey Guys,

Just wondering what the best tool is to really check JS scripts and look at ways of improving overall performance to the "utmost maximum" in terms of size and speed?

From stackoverflow
  • I like using Firebug's profiler for improving overall speed. It'll show you how many times each function is called, how long it took to execute (average and overall), and the percentage of the total JS execution time the function took. I'm not a big fan of micro-optimization, so I don't use any tools to get the "utmost maximum" out of my code, but the profiler helps weed out the bigger issues.

    As for size, I use the YUI compressor to minimize the size of my JavaScript files. (There are other JavaScript minification tools out there, I am just most used to YUI's.)

  • And if you've got Safari 4, you can use the JavaScript Profiler in its Web Inspector.

    For compressing your code, I like the JavaScript Packer by Dean Edwards.

    Steve

    Kent Fredric : PACKER will actually make things *bigger* vs GZIP transports and will slow down load time with the initial parse/eval loop. Just minify it and use GZIP transport.
    Steve Harrison : But the Packer *is* a 'minifier'. For me, the Packer has always minified things reasonably well (such as reducing a file from 28 KB to 16 KB), and the Base62 encode (which adds the initial parse/eval loop) is optional.
  • I usually follow the following steps.

    1. Using JSLint - http://www.jslint.com/ optimize the script.
    2. Use YUI Compressor.
    3. Profile the script. See Firebug & YSlow.
  • Guys, thanks so much - also check this out

    http://www.microsoft.com/downloads/details.aspx?FamilyID=119F3477-DCED-41E3-A0E7-D8B5CAE893A3&displaylang=en

    http://msdn.microsoft.com/en-us/magazine/dd188562.aspx

0 comments:

Post a Comment