I'm writing jQuery for a page that is a complex mess of many DOM elements (I have no control over this). The primary target browser is IE7, and I have concerns about the speed of its JavaScript engine. Scripts I've already written are laggy and have been performance-tuned to the best of my ability.
I could write script that is simple to maintain and understand, for example using a single contains
statement. Or I can help out the engine by narrowing down the DOM search through this messy HTML resulting in more complexity.
Should I care about the speed of the browser's JavaScript engine when writing jQuery scripts?