diff --git a/speed/benchmark.js b/speed/benchmark.js index 50d5cad69..b970e14af 100644 --- a/speed/benchmark.js +++ b/speed/benchmark.js @@ -5,11 +5,11 @@ function benchmark(fn, times, name){ e = fn.lastIndexOf('}'); fn = fn.substring(s,e); - return benchmarkString(fn, times, name); + return benchmarkString(fn, times, name); } function benchmarkString(fn, times, name) { - var fn = new Function("i", "var t=new Date; while(i--) {" + fn + "}; return new Date - t")(times) - fn.displayName = name || "benchmarked"; - return fn; + var fn = new Function("i", "var t=new Date; while(i--) {" + fn + "}; return new Date - t")(times) + fn.displayName = name || "benchmarked"; + return fn; } diff --git a/speed/benchmarker.css b/speed/benchmarker.css index 6fc8154c6..6c5b4c35b 100644 --- a/speed/benchmarker.css +++ b/speed/benchmarker.css @@ -1,10 +1,10 @@ - .dialog { - margin-bottom: 1em; - } - a.expand { - background: #e3e3e3; - } + .dialog { + margin-bottom: 1em; + } + a.expand { + background: #e3e3e3; + } div#time-test { font-family: Arial, Helvetica, sans-serif; @@ -42,14 +42,14 @@ text-align: center; } - #time-test { - margin: 1em 0; - padding: .5em; - background: #e3e3e3; - } - #time-taken { - font-weight: bold; - } + #time-test { + margin: 1em 0; + padding: .5em; + background: #e3e3e3; + } + #time-taken { + font-weight: bold; + } span.wins { color: #330; @@ -62,4 +62,4 @@ div.buttons { margin-top: 10px; margin-bottom: 10px; - } \ No newline at end of file + } diff --git a/speed/benchmarker.js b/speed/benchmarker.js index bfcc16ed9..602f5ac31 100644 --- a/speed/benchmarker.js +++ b/speed/benchmarker.js @@ -1,41 +1,41 @@ jQuery.benchmarker.tests = [ - // 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" + // 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() { @@ -110,7 +110,7 @@ timeArr.push(new Date() - time); } var diff = Math.sum(timeArr) - Math.max.apply( Math, timeArr ) - - Math.min.apply( Math, timeArr ); + - Math.min.apply( Math, timeArr ); try { var libRes = window[libraries[0]](code); var jqRes = jQuery(code); diff --git a/speed/closest.html b/speed/closest.html index bb31f5d8b..12469f7db 100644 --- a/speed/closest.html +++ b/speed/closest.html @@ -6,34 +6,34 @@ - + }); + }); +
-Hello
-lorem ipsum
-dolor sit amet
-Hello
+lorem ipsum
+dolor sit amet
+