]> source.dussan.org Git - jquery.git/commitdiff
Make some more tweaks to the closest perf test suite.
authorjeresig <jeresig@gmail.com>
Sun, 10 Oct 2010 17:39:06 +0000 (13:39 -0400)
committerjeresig <jeresig@gmail.com>
Sun, 10 Oct 2010 17:39:06 +0000 (13:39 -0400)
speed/closest.html

index ca2017480b2ea8e8adedece6a28e26b2425211e4..bb31f5d8b35512a5f7c47168f9b55aa7b02996af 100644 (file)
@@ -1,7 +1,7 @@
 <!doctype html>
 <html>
 <head>
-       <title>Test Event Handling Performance</title>
+       <title>Test .closest() Performance</title>
        <script src="benchmark.js"></script>
        <script src="jquery-basis.js"></script>
        <script>var old = jQuery.noConflict(true);</script>
       var node = $("#child"), name;
 
       jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
-        name = "closest '" + item + "'";
+       setTimeout(function(){
+               name = "closest '" + item + "'";
 
-       jQuery("#results").append("<li>" + name + "<ul>" +
-               "<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 500, name) + "</li>" +
-               "<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 500, name) + "</li>"
-               + "</ul></li>");
+               jQuery("#results").append("<li>" + name + "<ul>" +
+                       "<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "</li>" +
+                       "<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "</li>"
+                       + "</ul></li>");
+       }, 100);
       });
     });
   </script>