John Resig wrote:
>> The thread about benchmarks got me thinking about compilation and caching of
>> selectors too. It could be a big win for benchmarks where they use the same
>> selector in a loop 1000 times! :-)
> 
> The problem with caching is that it's unable to handle situations
> where the DOM changes in-between, unless there's an explicit
> .refreshCache() or some such. And doing this by default is hardly
> desirable, as it would cause a lot of common code to break. It is
> something that is definitely explorable "some day" - I'm just afraid
> that the payoff may not be worth it.

The cache isn't for the DOM at all, it caches compiled selectors as
native javascript functions, so that the selector string doesn't need
to be parsed everytime.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to