X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=speed%2Fclosest.html;h=bb31f5d8b35512a5f7c47168f9b55aa7b02996af;hb=2a47ceae5b9bdc45fdc890e3cd5ec01c82db1688;hp=eacf74935ed47d2bfb138d3c8cdf56b8c19b12cd;hpb=0ca35de311ff4d1dac5c9dc4de05a32a1754cd7a;p=jquery.git
diff --git a/speed/closest.html b/speed/closest.html
index eacf749..bb31f5d 100644
--- a/speed/closest.html
+++ b/speed/closest.html
@@ -1,7 +1,7 @@
- Test Event Handling Performance
+ Test .closest() Performance
@@ -10,15 +10,18 @@
jQuery(function ready() {
var node = $("#child"), name;
- [".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"].forEach(function foreach(item) {
- name = "closest '" + item + "'";
- console.log(name);
+ jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
+ setTimeout(function(){
+ name = "closest '" + item + "'";
- console.log("new", benchmarkString("$('#child').closest('" + item + "')", 5000, name));
- console.log("old", benchmarkString("old('#child').closest('" + item + "')", 5000, name));
+ jQuery("#results").append("" + name + "" +
+ "- new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "
" +
+ "- old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "
"
+ + "
");
+ }, 100);
});
});
-
+
@@ -30,6 +33,7 @@
+