Updated the benchmarking utility to use the Yahoo homepage and a bunch of new selectors.

This commit is contained in:
John Resig 2009-01-12 18:22:44 +00:00
parent 944484c3fe
commit 9c029f1687
2 changed files with 41 additions and 457 deletions

View file

@ -1,19 +1,42 @@
jQuery.benchmarker.tests = [ jQuery.benchmarker.tests = [
"*", // Selectors from:
"body", "body div", "div", // http://ejohn.org/blog/selectors-that-people-actually-use/
"div div div", "div div", ".dialog", "div.dialog", "div .dialog", /*
"#speech5", "div#speech5", "div #speech5", "div > div", "div.scene div.dialog", // For Amazon.com
"div#scene1.scene div.dialog div.direction", "#scene1 #speech1", "body > div.dialog div div#speech5", "#navAmazonLogo", "#navSwmSkedPop",
"div:not(#speech5)", "div:not(.dialog)", ".navbar", ".navGreeting",
"div:nth-child(even)", "div:nth-child(odd)", "div", "table",
"div:nth-child(1)", "div:nth-child(2n)", "img.navCrossshopTabCap", "span.navGreeting",
"div:nth-child(2n+3)", "div:first-child", "#navbar table", "#navidWelcomeMsg span",
"div:last-child", "div:only-child", "div#navbar", "ul#navAmazonLogo",
"div:contains(CELIA)", "#navAmazonLogo .navAmazonLogoGatewayPanel", "#navidWelcomeMsg .navGreeting",
"div ~ div", "div + div", ".navbar .navAmazonLogoGatewayPanel", ".navbar .navGreeting",
"div[class]", "div[class=dialog]", "div[class!=dialog]", "*",
"div[class^=dialog]", "div[class$=dialog]", "div[class*=dialog]" "#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() { jQuery.fn.benchmark = function() {
this.each(function() { this.each(function() {

File diff suppressed because one or more lines are too long