Dave Ward has a very extensive post (with benchmarks) on jQuery selector optimization. Really interesting stuff — the lesson is, the more specific your query, the faster it executes. The DOM is a data source, after all. He was able to achieve a 10x performance improvement by adding just 11 characters.