jQuery CSS3 Not vs. .Not()
JavaScript performance comparison
Info
The jQuery docs specify that it's better to use .not() over $('x:not(y)'). Testing to make sure that's the case in all browsers.
Preparation code
<script>
try {
document.qsa = document.querySelectorAll;
document.querySelectorAll = null;
} catch(e){}
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="container">
<div id="header"> Header </div>
<div>Div</div>
</div>
Preparation code output
Header
Div
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
CSS3 Selector (QSA) |
|
pending… |
CSS3 Selector (jQ) |
|
pending… |
Not() Method |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Jeffrey Way
- Revision 5: published by John-David Dalton
- Revision 7: published
- Revision 8: published
- Revision 9: published
- Revision 10: published
- Revision 11: published
- Revision 12: published
- Revision 13: published
- Revision 14: published
- Revision 15: published
- Revision 18: published
- Revision 20: published
- Revision 21: published
- Revision 22: published
- Revision 23: published by rein
- Revision 25: published by jD
0 comments