mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Make some more tweaks to the closest perf test suite.
This commit is contained in:
parent
6f0b06aa9b
commit
63c892b1ed
@ -1,7 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Test Event Handling Performance</title>
|
<title>Test .closest() Performance</title>
|
||||||
<script src="benchmark.js"></script>
|
<script src="benchmark.js"></script>
|
||||||
<script src="jquery-basis.js"></script>
|
<script src="jquery-basis.js"></script>
|
||||||
<script>var old = jQuery.noConflict(true);</script>
|
<script>var old = jQuery.noConflict(true);</script>
|
||||||
@ -11,12 +11,14 @@
|
|||||||
var node = $("#child"), name;
|
var node = $("#child"), name;
|
||||||
|
|
||||||
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
|
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>" +
|
jQuery("#results").append("<li>" + name + "<ul>" +
|
||||||
"<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 500, name) + "</li>" +
|
"<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "</li>" +
|
||||||
"<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 500, name) + "</li>"
|
"<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "</li>"
|
||||||
+ "</ul></li>");
|
+ "</ul></li>");
|
||||||
|
}, 100);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user