X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=inline;f=build%2Fspeed%2Fbenchmarker.js;h=bfcc16ed98379d586fc30250cc2e6e6db1fdf9e2;hb=ad7577a084136c48c1544e4831b1d7e69dc55f2a;hp=a04e5acc9902f9f41a96e9a2b2e313eea9359489;hpb=73ab36b8f8f14ed7872bf930a08d8eae68f30fda;p=jquery.git diff --git a/build/speed/benchmarker.js b/build/speed/benchmarker.js index a04e5ac..bfcc16e 100755 --- a/build/speed/benchmarker.js +++ b/build/speed/benchmarker.js @@ -1,18 +1,42 @@ jQuery.benchmarker.tests = [ - "*", - "body", "body div", "div", - "div div div", "div div", ".dialog", "div.dialog", "div .dialog", - "#speech5", "div#speech5", "div #speech5", "div > div", "div.scene div.dialog", - "div#scene1.scene div.dialog div", "#scene1 #speech1", "body > div.dialog div#speech5", - "div:nth-child(even)", "div:nth-child(odd)", - "div:nth-child(1)", "div:nth-child(2n)", - "div:nth-child(2n+3)", "div:first-child", - "div:last-child", "div:only-child", - "div:contains(CELIA)", - "div ~ div", "div + div", - "div[@class]", "div[@class=dialog]", "div[@class!=dialog]", - "div[@class^=dialog]", "div[@class$=dialog]", "div[@class*=dialog]" - ] + // Selectors from: + // http://ejohn.org/blog/selectors-that-people-actually-use/ + /* + // For Amazon.com + "#navAmazonLogo", "#navSwmSkedPop", + ".navbar", ".navGreeting", + "div", "table", + "img.navCrossshopTabCap", "span.navGreeting", + "#navbar table", "#navidWelcomeMsg span", + "div#navbar", "ul#navAmazonLogo", + "#navAmazonLogo .navAmazonLogoGatewayPanel", "#navidWelcomeMsg .navGreeting", + ".navbar .navAmazonLogoGatewayPanel", ".navbar .navGreeting", + "*", + "#navAmazonLogo li.navAmazonLogoGatewayPanel", "#navidWelcomeMsg span.navGreeting", + "a[name=top]", "form[name=site-search]", + ".navbar li", ".navbar span", + "[name=top]", "[name=site-search]", + "ul li", "a img", + "#navbar #navidWelcomeMsg", "#navbar #navSwmDWPop", + "#navbar ul li", "#navbar a img" + */ + // For Yahoo.com + "#page", "#masthead", "#mastheadhd", + ".mastheadbd", ".first", ".on", + "div", "li", "a", + "div.mastheadbd", "li.first", "li.on", + "#page div", "#dtba span", + "div#page", "div#masthead", + "#page .mastheadbd", "#page .first", + ".outer_search_container .search_container", ".searchbox_container .inputtext", + "*", + "#page div.mastheadbd", "#page li.first", + "input[name=p]", "a[name=marketplace]", + ".outer_search_container div", ".searchbox_container span", + "[name=p]", "[name=marketplace]", + "ul li", "form input", + "#page #e2econtent", "#page #e2e" + ]; jQuery.fn.benchmark = function() { this.each(function() { @@ -20,8 +44,8 @@ jQuery(this).parent().children("*:gt(1)").remove(); } catch(e) { } }) - var times = 5; - jQuery("#times").html(times); + // set # times to run the test in index.html + var times = parseInt(jQuery("#times").val()); jQuery.benchmarker.startingList = this.get(); benchmark(this.get(), times, jQuery.benchmarker.libraries); } @@ -33,13 +57,13 @@ jQuery("tbody tr:first-child").remove(); jQuery("td.test").before("