From: jeresig Date: Sun, 10 Oct 2010 17:22:39 +0000 (-0400) Subject: Some improvements to the closest perf tests - works in all browsers now. X-Git-Url: http://git.asbjorn.it/?p=jquery.git;a=commitdiff_plain;h=96d8c481b8cf64eb7ba789fce709e655f7706fd7 Some improvements to the closest perf tests - works in all browsers now. --- diff --git a/speed/closest.html b/speed/closest.html index eacf749..ca20174 100644 --- a/speed/closest.html +++ b/speed/closest.html @@ -10,15 +10,16 @@ jQuery(function ready() { var node = $("#child"), name; - [".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"].forEach(function foreach(item) { + jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) { name = "closest '" + item + "'"; - console.log(name); - console.log("new", benchmarkString("$('#child').closest('" + item + "')", 5000, name)); - console.log("old", benchmarkString("old('#child').closest('" + item + "')", 5000, name)); + jQuery("#results").append("
  • " + name + "
  • "); }); }); - +
    @@ -30,6 +31,7 @@
    +