You might already have figured out that .innerHTML can be way faster than using the DOM. But did you know that when clearing out existing code the DOM can be faster than .innerHTML? Take a look the article When innerHTML isn’t fast enough to see some impressive benchmarks and a simple solution.
YSlow is a Firefox plug-in which analyzes web pages and tells you why they’re slow based on Yahoo’s rules for high performance web sites. These rules are:
- Make Fewer HTTP Requests
- Use a Content Delivery Network
- Add an Expires Header
- Gzip Components
- Put CSS at the Top
- Move Scripts to the Bottom
- Avoid CSS Expressions
- Make JavaScript and CSS External
- Reduce DNS Lookups
- Minify JavaScript
- Avoid Redirects
- Remove Duplicate Scripts
- Configure ETags
Definitely worth checking out if you need to tweak every ounce of performance you can get on certain pages.