Most of the cast javascript are pretty fast to execute, but sometime you still need to profile and tuning, this is a good resource about this area http://www.xml.com/lpt/a/2005/11/30/tuning-ajax-performance.html