aboutsummaryrefslogtreecommitdiffstats
path: root/speed
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-10-10 14:51:11 -0400
committerjeresig <jeresig@gmail.com>2010-10-10 14:51:11 -0400
commit1f7bbd8939d1238c91942c6f0d49f9944f8db635 (patch)
tree55507c256600793d0bfff5fae8df1734c112441f /speed
parentf2b028f736a46d4b3592b32df751db8e0f34f403 (diff)
downloadjquery-1f7bbd8939d1238c91942c6f0d49f9944f8db635.tar.gz
jquery-1f7bbd8939d1238c91942c6f0d49f9944f8db635.zip
Also test for single element filtering.
Diffstat (limited to 'speed')
-rw-r--r--speed/filter.html11
1 files changed, 8 insertions, 3 deletions
diff --git a/speed/filter.html b/speed/filter.html
index 876206d87..f24ed7d94 100644
--- a/speed/filter.html
+++ b/speed/filter.html
@@ -13,11 +13,14 @@
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){
name = "filter '" + item + "'";
-
jQuery("#results").append("<li>" + name + "<ul>" +
"<li>new: " + benchmarkString("$('div').filter('" + item + "')", 1000, name) + "</li>" +
- "<li>old: " + benchmarkString("old('div').filter('" + item + "')", 1000, name) + "</li>"
- + "</ul></li>");
+ "<li>old: " + benchmarkString("old('div').filter('" + item + "')", 1000, name) + "</li>" +
+ "</ul></li>");
+ jQuery("#results").append("<li>single " + name + "<ul>" +
+ "<li>new: " + benchmarkString("$('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" +
+ "<li>old: " + benchmarkString("old('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" +
+ "</ul></li>");
}, 100);
});
});
@@ -26,6 +29,8 @@
<body>
<div>
<p>Hello</p>
+ <div class="zoo" id="nonexistant" data-foo="bar"><div></div></div>
+ <div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>