classList v old way
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div data-fixture id="a"></div>
<div data-fixture id="b"></div>
<script>
var a = document.getElementById("a"),
b = $("#b");
</script>
<script>
Benchmark.prototype.teardown = function() {
$("[data-fixture]").attr("class", "");
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
classList |
|
pending… |
jQuery |
|
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 Rick Waldron
- Revision 2: published
- Revision 3: published by Dave Dopson
- Revision 4: published by m_gol
- Revision 5: published by m_gol
- Revision 6: published
- Revision 7: published by m_gol
- Revision 8: published by m_gol
- Revision 9: published
- Revision 10: published by m_gol
0 comments