Just when I think I've got my head around performance tuning for MS SQl Databases, and keeping ASP code trim and sprightly (and even writing PHP scripts that don't suck too badly) ... it turns out I have to start spending a bit more time performance tuning my JavaScripts!

Yup. As Ajax and the Web 2.0 wave start putting a lot more onus on the client to do some of the heavy lifting JavaScript is starting to take on a much larger role in the delivery - and hence performance - of the user experience.

As JavaScript isn't a compiled language (at least, not usually... though there is one to turn JavaScript into Java - which opens up a potential whole new world of hurt!) there are some things you can do manually to ensure your code it well written to reduce reliance on inefficient coding constructs. See this post for more info on things to avoid (and there's 2 more parts to come apparently - I'm scared!) and this article for some more tips on how to do it right.

Once your code is well written there is a further step you can go to - optimisation of the JavaScript source. A few years ago I discovered an awesome little utility (w3compiler from Port80) that makes my JavaScript as lean and mean as it can (and it also works its magic on HTML and CSS source files too)

Happy coding!