git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f2b028f
)
Also test for single element filtering.
author
jeresig
<jeresig@gmail.com>
Sun, 10 Oct 2010 18:51:11 +0000
(14:51 -0400)
committer
jeresig
<jeresig@gmail.com>
Sun, 10 Oct 2010 18:51:11 +0000
(14:51 -0400)
speed/filter.html
patch
|
blob
|
history
diff --git
a/speed/filter.html
b/speed/filter.html
index
876206d
..
f24ed7d
100644
(file)
--- 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.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>" +
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);
});
});
}, 100);
});
});
@@
-26,6
+29,8
@@
<body>
<div>
<p>Hello</p>
<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>
<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>