It's the calls to $(li).find('li.News a') that make for most of the
difference. Without that 1.3.1 is up to 20% faster.

Apparently a simple descendant selector in 1.3 is terribly slower i.e.
$(el).find('div a') if any <a>s exist (even outside the context). Also
'.someclass a' is faster than 'li.someclass a' which doesn't make any
sense. I put a test case at

http://jquery.nodnod.net/cases/142

Guess it has to do with the "bottom up" traversing approach in Sizzle.

cheers,
- ricardo

On Feb 20, 7:02 am, Sjoland <jo...@sjoland.com> wrote:
> The markup look like this:
>
> <li class="MenuItem processMenuItem" id="MENUID-D">
> <a href="processing/x/">X<br>Processing</a>
> <ul>
> <li class="Intro">
> <h4>If you recieve 20,000 invoices per year, you can save at least
> $100,000</h4>
> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
> eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
> </li>
> <li class="News Disabled">
> <a href="processing/x/news/" title="News summary.">News text...</a>
> </li>
> <li class="Splash Disabled">
> <a href="processing/x/splash/" title="Splash summary.">Splash text...</
> a>
> <img src="media/splashImage.jpg">
> </li>
> <li class="Anchor"><a href="processing/x/#Overview">Overview</a></li>
> <li class="Anchor"><a href="processing/x/#Introduction" title="We are
> experts in sorting.">Introduction</a></li>
> <li class="Anchor"><a href="processing/x/#Article">Article</a></li>
> <li class="Anchor"><a href="processing/x/#Features">Features</a></li>
> <li class="Anchor"><a href="processing/x/#References" title="IKEA,
> Porsche, Pfizer, SAS, Tetra Pak, Carlsberg, DaimlerChrysler, LEGO,
> Bosch, DFDS transport, Canon...">References</a></li>
> <li class="Anchor"><a href="processing/x/#Technical">Technical</a></
> li>
> <li class="Anchor"><a href="processing/x/#Integration" title="Lorem
> ipsum dolor sit amet.">Integration</a></li>
> <li class="Anchor"><a href="processing/x/#Downloads">Downloads</a></
> li>
> </ul>
> </li>
>
> The timer looks like this:
> var timer = {
>         time: 0,
>         now: function(){ return (new Date()).getTime(); },
>         start: function(){ this.time = this.now(); },
>         since: function(){ return this.now()-this.time; }
>
> };
>
> ...and I start the timer in the last row of the last script being
> loaded...
>
> Yes, I know there are many ways to improve and optimize my methods,
> BUT that's not my main issue right now, becuse any improvment like the
> one Ricardobeat suggests still ends up with less speed in 1.3.1 vs
> 1.2.6.
>
> Thanks,
> /Johan

Reply via email to