From 96d8c481b8cf64eb7ba789fce709e655f7706fd7 Mon Sep 17 00:00:00 2001 From: jeresig Date: Sun, 10 Oct 2010 13:22:39 -0400 Subject: [PATCH] Some improvements to the closest perf tests - works in all browsers now. --- speed/closest.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 @@
    + -- 1.7.10.4